sassi 0.1.0-beta.1

Typed in-memory pool with composable predicate algebra and cross-runtime trait queries.
Documentation
[package]
name = "sassi"
description = "Typed in-memory pool with composable predicate algebra and cross-runtime trait queries."
readme = "../README.md"
keywords = ["cache", "lru", "predicate", "query", "rust"]
categories = ["caching", "data-structures"]
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
authors.workspace = true
rust-version.workspace = true

[features]
# `serde` enables the wire-format envelope and backend integrations.
# `runtime-tokio` enables the optional background TTL sweep task and is
# the typical setup for native consumers; tests rely on it via
# `#[tokio::test]`. `runtime-wasm` is the WASM-target counterpart and
# selects the gloo-timers-based executor.
#
# Selecting `runtime-wasm` only makes sense when building for
# `wasm32-unknown-unknown` — the deps it pulls in
# (`wasm-bindgen-futures`, `gloo-timers`) build cleanly on native too,
# so the feature flag can be enabled on native builds without breakage,
# but the executor's `spawn` / `sleep` paths only fire under
# `target_arch = "wasm32"`. Native + `runtime-wasm` is therefore inert.
default = ["serde", "runtime-tokio"]
serde = ["dep:serde", "dep:serde_json"]
runtime-tokio = []
runtime-wasm = ["dep:wasm-bindgen-futures", "dep:gloo-timers"]
watermark-time = ["dep:time"]
watermark-chrono = ["dep:chrono"]

[dependencies]
# `tokio` is unconditional — the broadcast channel that backs Punnu's
# event stream lives behind `tokio::sync` and works on every supported
# target, including WASM. The `runtime-tokio` feature only governs
# whether the spawn-driven background sweep task is compiled in.
tokio = { workspace = true }
futures = { workspace = true }
serde = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }
dashmap = { workspace = true }
arc-swap = { workspace = true }
im = { workspace = true }
fastrand = { workspace = true }
tracing = { workspace = true }
async-trait = { workspace = true }
thiserror = { workspace = true }
sassi-macros = { path = "../sassi-macros", version = "0.1.0-beta.1" }
inventory = { workspace = true }
# `web-time` is a drop-in for `std::time::Instant` that works on
# `wasm32-unknown-unknown`. Used only on wasm — native builds keep
# `tokio::time::Instant` so tests retain `tokio::time::pause()` /
# `advance(...)` determinism. The dep is unconditional because feature
# resolution is per-package (not per-target); the actual usage is
# gated `#[cfg(target_arch = "wasm32")]` in the source.
web-time = { workspace = true }
# Optional WASM-only spawn / sleep deps. Activated by `runtime-wasm`.
# Declared as `optional = true` so the default native build doesn't
# pull them in.
wasm-bindgen-futures = { workspace = true, optional = true }
gloo-timers = { workspace = true, optional = true }
time = { workspace = true, optional = true }
chrono = { workspace = true, optional = true }

[dev-dependencies]
# `test-util` enables `tokio::time::pause` / `advance` and the
# `#[tokio::test(start_paused = true)]` attribute. Required by the
# TTL test files (`punnu_ttl_lazy.rs`, `punnu_ttl_sweep.rs`) so they
# can drive virtual time deterministically instead of relying on
# real `sleep` calls. Dev-only; never linked into a production build.
tokio = { version = "1.52", default-features = false, features = ["sync", "rt", "time", "macros", "test-util"] }
proptest = { workspace = true }
tempfile = "3"
trybuild = { workspace = true }
criterion = { workspace = true }

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