rustis 0.21.0

Redis async driver for Rust
Documentation
[package]
name = "rustis"
version = "0.21.0"
keywords = ["redis", "database", "async", "cluster", "sentinel"]
categories = ["database", "asynchronous"]
description = "Redis async driver for Rust"
homepage = "https://github.com/dahomey-technologies/rustis"
repository = "https://github.com/dahomey-technologies/rustis"
documentation = "https://docs.rs/rustis"
readme = "README.md"
license-file = "LICENSE"
edition = "2024"
# Held here by let chains, used in 63 places. Edition 2024 alone would allow
# 1.85. Verified by the `msrv` CI job, which is what keeps this number true.
rust-version = "1.88"

[features]
default = ["tokio-runtime"]
tokio-runtime = ["tokio/macros", "tokio/net", "tokio/rt", "tokio/io-util"]
tokio-rustls = ["dep:tokio-rustls", "dep:webpki-roots", "rustls"]
tokio-native-tls = ["dep:tokio-native-tls", "native-tls"]
pool = ["dep:bb8"]
native-tls = ["dep:native-tls"]
rustls = ["dep:rustls"]
json = ["dep:serde_json"]
client-cache = ["dep:moka", "dep:dashmap"]
bench = ["dep:criterion", "dep:fred", "dep:redis", "dep:pprof"]
# Exposes internal RESP parsing/deserialization entry points to the `cargo-fuzz`
# targets in `fuzz/`. Not part of the public API; no stability guarantee.
fuzzing = []
web-examples = ["dep:axum", "dep:actix-web"]

[dependencies]
futures-util = { version = "0.3", features = ["sink"] }
futures-channel = { version = "0.3", features = ["sink"] }
bytes = { version = "1.11", features = ["serde"] }
tokio = { version = "1.49", features = ["time", "io-util", "sync"] }
tokio-util = { version = "0.7", features = ["codec"] }
atoi = "2.0"
itoa = "1.0"
fast-float2 = "0.2"
dtoa = "1.0"
smallvec = { version = "1.15", features = ["union", "serde"] }
# Lock-free MPMC queue backing the pub/sub channel. Its producer can pop the
# head, which is what lets a full channel drop its oldest message without the
# network task ever waiting on the subscriber.
crossbeam-queue = "0.3"
bb8 = { version = "0.9", optional = true }
url = "2.5"
tokio-rustls = { version = "0.26", optional = true }
webpki-roots = { version = "1.0", optional = true }
native-tls = { version = "0.2", optional = true }
rustls = { version = "0.23", optional = true }
tokio-native-tls = { version = "0.3", optional = true }
# The `log` feature makes every event also emit a `log` record, so a downstream
# crate wired to `env_logger` and friends keeps receiving output unchanged and
# only sees a difference if it installs a `tracing` subscriber.
tracing = { version = "0.1", features = ["log"] }
crc16 = "0.4"
rand = "0.9"
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", optional = true }
socket2 = "0.6"
memchr = "2.7"
moka = { version = "0.12", features = ["future"], optional = true }
dashmap = { version = "6.1", optional = true }
# optional dev dependencies
criterion = { version = "0.8", features = ["async_tokio"], optional = true }
fred = { version = "10.1", optional = true }
redis = { version = "1.0", features = ["aio", "tokio-comp"], optional = true }
axum = { version = "0.8", optional = true }
actix-web = { version = "4.12", optional = true }
pprof = { version = "0.15", features = ["flamegraph"], optional = true }
thiserror = "2.0"

[dev-dependencies]
serial_test = "3.3"
tokio = { version = "1.49", features = ["rt-multi-thread"] }
rand = "0.9"
# The suite reads the crate's output through `env_logger`, which is the point:
# it exercises the `tracing/log` bridge that downstream `log` users rely on.
env_logger = "0.11"
log = "0.4"
tracing-subscriber = "0.3"
smallvec = { version = "1.15", features = ["serde"] }
rustls-pemfile = "2.2"

[package.metadata.docs.rs]
features = ["tokio-runtime", "tokio-rustls", "pool", "json", "client-cache"]
rustdoc-args = ["--cfg", "docsrs"]

[[bench]]
name = "generic_api"
harness = false
required-features = ["bench"]

[[bench]]
name = "multiplexer"
harness = false
required-features = ["bench"]

[[bench]]
name = "throughput"
harness = false
required-features = ["bench"]

[[bench]]
name = "native_api"
harness = false
required-features = ["bench"]

[[bench]]
name = "pipeline"
harness = false
required-features = ["bench"]

[[bench]]
name = "fast_path"
harness = false
required-features = ["bench"]

[[bench]]
name = "parse_integer"
harness = false
required-features = ["bench"]

[[bench]]
name = "large_array_parsing"
harness = false
required-features = ["bench"]

[[bench]]
name = "resp_parsing"
harness = false
required-features = ["bench"]

[[bench]]
name = "tape_memory"
harness = false
required-features = ["bench"]

[[bench]]
name = "command_encode"
harness = false
required-features = ["bench"]

[[bench]]
name = "large_reply_reserve"
harness = false
required-features = ["bench"]

[[bench]]
name = "cluster_read_alloc"
harness = false
required-features = ["bench"]

[[bench]]
name = "struct_decode"
harness = false
required-features = ["bench"]

[[example]]
name = "actix_crud"
required-features = ["tokio-runtime", "web-examples"]

[[example]]
name = "actix_long_polling_pubsub"
required-features = ["tokio-runtime", "web-examples"]

[[example]]
name = "axum_crud"
required-features = ["tokio-runtime", "web-examples"]

[[example]]
name = "axum_long_polling_pubsub"
required-features = ["tokio-runtime", "web-examples"]

[[example]]
name = "cbor"
required-features = ["tokio-runtime"]

[[example]]
name = "loop"
required-features = ["tokio-runtime"]

[[example]]
name = "pprof_pipeline"
required-features = ["tokio-runtime", "bench"]

[[example]]
name = "resp_profiling"
required-features = ["tokio-runtime", "bench"]

[[example]]
name = "command_construction_profiling"
required-features = ["tokio-runtime", "bench"]

[[example]]
name = "pprof_multiplexer_get"
required-features = ["tokio-runtime", "bench"]

[[example]]
name = "pprof_send_vs_receive"
required-features = ["tokio-runtime", "bench"]

[[example]]
name = "conn_scaling_probe"
required-features = ["tokio-runtime", "bench"]

[[example]]
name = "head_to_head"
required-features = ["tokio-runtime", "bench"]

[[example]]
name = "wakeup_cost_probe"
required-features = ["tokio-runtime"]

[[example]]
name = "strace_workload"
required-features = ["tokio-runtime", "bench"]

[[example]]
name = "cache_stampede_probe"
required-features = ["tokio-runtime", "client-cache"]

[[example]]
name = "simple"
required-features = ["tokio-runtime"]

[profile.dev]
opt-level = 0
debug = true
debug-assertions = true
overflow-checks = true

[profile.bench]
opt-level = 3
lto = "fat"
codegen-units = 1