[package]
name = "trypema"
version = "0.1.0-rc.13"
edition = "2024"
readme = "README.md"
description = "High-performance rate limiting primitives in Rust, designed for concurrency safety, low overhead, and predictable latency."
license = "MIT"
categories = ["algorithms", "concurrency", "data-structures"]
keywords = [
  "rate-limiting",
  "rate-limiter",
  "throttling",
  "concurrency",
  "atomic",
]
authors = ["Oyinbo David Bayode <dev.davexoyinbo@gmail.com>"]
documentation = "https://docs.rs/trypema"
repository = "https://github.com/dev-davexoyinbo/trypema"
homepage = "https://trypema.davidoyinbo.com/"
exclude = [".github", "Makefile", "compose.yaml", "stress", "BENCH.md"]

[profile.release]
lto = "fat"
codegen-units = 1
# opt-level = 3
# opt-level = "z"
# opt-level = "s"
opt-level = 3
# strip = "debuginfo"
strip = "symbols"

[workspace]
members = ["stress"]

[package.metadata.docs.rs]
features = ["redis-tokio"]
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
dashmap = "6.1.0"
rand = "0.10.0"
redis = { version = "1.0.4", optional = true, default-features = false, features = [
  "script",
] }
strum = "0.28.0"
strum_macros = "0.28.0"
thiserror = "2.0.18"
tracing = "0.1.44"
tokio = { version = "1.49.0", optional = true, default-features = false }
smol = { version = "2.0.2", optional = true }
ahash = "0.8.12"
futures = "0.3.32"
async-trait = { version = "0.1.89", optional = true }

[features]
redis-tokio = [
  "redis",
  "redis/tokio-comp",
  "redis/aio",
  "redis/connection-manager",
  "dep:tokio",
  "tokio/sync",
  "tokio/rt",
  "tokio/time",
  "tokio/macros",
  "tokio/rt-multi-thread",
  "dep:async-trait",
]
redis-smol = [
  "redis",
  "redis/smol-comp",
  "redis/aio",
  "redis/connection-manager",
  "dep:smol",
  "dep:tokio",
  "tokio/sync",
  "dep:async-trait",
]

[dev-dependencies]
tokio = { version = "1.49.0", features = ["rt-multi-thread"] }
criterion = { version = "0.8", default-features = false, features = [
  "cargo_bench_support",
  "rayon",
  "plotters",
] }

[[bench]]
name = "local_absolute"
harness = false

[[bench]]
name = "local_suppressed"
harness = false

[[bench]]
name = "redis_absolute"
harness = false

[[bench]]
name = "redis_suppressed"
harness = false
