[package]
name = "ws-kit"
version = "1.0.1"
edition = "2021"
rust-version = "1.85"
license = "MIT OR Apache-2.0"
repository = "https://github.com/WyattAu/ws-kit"
description = "Generic authenticated typed WebSocket: BroadcastHub, RoomManager, heartbeat"
keywords = ["websocket", "realtime", "axum", "broadcast"]
categories = ["web-programming", "asynchronous"]
exclude = ["/target"]
readme = "README.md"
[dependencies]
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "sync", "time"] }
axum = { version = "0.8", features = ["ws"], optional = true }
http = { version = "1", optional = true }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "2"
dashmap = "6"
bytes = { version = "1", features = ["serde"] }
flate2 = { version = "1", default-features = false, features = ["rust_backend"], optional = true }
redis = { version = "0.32", default-features = false, features = ["tokio-comp"], optional = true }
futures-util = { version = "0.3", default-features = false, features = ["std"], optional = true }
metrics = { version = "0.24", optional = true }
[dev-dependencies]
tokio = { version = "1", features = ["full"] }
proptest = "1"
criterion = { version = "0.5", features = ["html_reports"] }
bytes = "1"
iai-callgrind = "0.16"
[target.'cfg(loom)'.dependencies]
loom = { version = "0.7", features = ["futures"] }
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(loom)'] }
[features]
default = ["axum"]
axum = ["dep:axum", "dep:http"]
compression = ["dep:flate2"]
redis = ["dep:redis", "dep:futures-util"]
metrics = ["dep:metrics"]
tracing = []
loom = []
[[test]]
name = "integration"
[[test]]
name = "redis_rooms"
required-features = ["redis"]
[[bench]]
name = "ws_bench"
harness = false
[[bench]]
name = "broadcast_roundtrip"
harness = false
[[bench]]
name = "iai_hot_path"
harness = false
[[bench]]
name = "compression_roundtrip"
harness = false
required-features = ["compression"]
[lints.clippy]
unwrap_used = "deny"
expect_used = "warn"
indexing_slicing = "deny"
panic = "deny"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[package.metadata.layers]
tier = "L2"