trypema 1.0.0

High-performance rate limiting primitives in Rust, designed for concurrency safety, low overhead, and predictable latency.
Documentation
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

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

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

[features]
redis-smol = [
    "redis",
    "redis/smol-comp",
    "redis/aio",
    "redis/connection-manager",
    "dep:smol",
    "dep:tokio",
    "tokio/sync",
    "dep:async-trait",
    "dep:futures",
]
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",
    "dep:futures",
]

[lib]
name = "trypema"
path = "src/lib.rs"

[[bench]]
name = "common"
path = "benches/common.rs"

[[bench]]
name = "local_absolute"
path = "benches/local_absolute.rs"
harness = false

[[bench]]
name = "local_suppressed"
path = "benches/local_suppressed.rs"
harness = false

[[bench]]
name = "redis_absolute"
path = "benches/redis_absolute.rs"
harness = false

[[bench]]
name = "redis_suppressed"
path = "benches/redis_suppressed.rs"
harness = false

[[bench]]
name = "runtime"
path = "benches/runtime.rs"

[dependencies.ahash]
version = "0.8.12"

[dependencies.async-trait]
version = "0.1.89"
optional = true

[dependencies.dashmap]
version = "6.1.0"

[dependencies.futures]
version = "0.3.32"
optional = true

[dependencies.rand]
version = "0.10.0"

[dependencies.redis]
version = "1.0.4"
features = ["script"]
optional = true
default-features = false

[dependencies.smol]
version = "2.0.2"
optional = true

[dependencies.strum]
version = "0.28.0"

[dependencies.strum_macros]
version = "0.28.0"

[dependencies.thiserror]
version = "2.0.18"

[dependencies.tokio]
version = "1.50.0"
optional = true
default-features = false

[dependencies.tracing]
version = "0.1.44"

[dev-dependencies.criterion]
version = "0.8"
features = [
    "cargo_bench_support",
    "rayon",
    "plotters",
]
default-features = false

[dev-dependencies.tokio]
version = "1.50.0"
features = ["rt-multi-thread"]

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