[package]
edition = "2024"
rust-version = "1.89"
name = "cached"
version = "3.0.0-rc.2"
authors = ["James Kominick <james@kominick.com>"]
build = false
exclude = [
".agents/",
".claude/",
".github/",
"bin/",
"docs/dev/",
"AGENTS.md",
"CLAUDE.md",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Generic cache implementations and simplified function memoization"
documentation = "https://docs.rs/cached"
readme = "README.md"
keywords = [
"cache",
"memoize",
"lru",
"redis",
"disk",
]
categories = [
"caching",
"data-structures",
]
license = "MIT"
repository = "https://github.com/jaemk/cached"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
"--cfg",
"docsrs",
]
[features]
ahash = [
"dep:ahash",
"hashbrown/default",
]
async = [
"async_core",
"dep:async-lock",
"dep:blocking",
]
async_core = []
default = [
"proc_macro",
"ahash",
"time_stores",
]
proc_macro = [
"cached_proc_macro",
"cached_proc_macro_types",
]
redb_store = [
"redb",
"serde",
"rmp-serde",
"directories",
]
redis_async_cache = [
"redis_store",
"async",
"redis_tokio",
"redis/cache-aio",
]
redis_connection_manager = [
"redis_tokio",
"redis/connection-manager",
]
redis_smol = [
"redis_store",
"async",
"redis/smol-comp",
]
redis_smol_native_tls = [
"redis_smol",
"redis/smol-native-tls-comp",
]
redis_smol_rustls = [
"redis_smol",
"redis/smol-rustls-comp",
]
redis_store = [
"redis",
"r2d2",
"serde",
"rmp-serde",
"serde_json",
]
redis_tokio = [
"redis_store",
"async",
"redis/tokio-comp",
]
redis_tokio_native_tls = [
"redis_tokio",
"redis/tokio-native-tls-comp",
]
redis_tokio_rustls = [
"redis_tokio",
"redis/tokio-rustls-comp",
]
time_stores = []
[lib]
name = "cached"
path = "src/lib.rs"
[[example]]
name = "async_std"
path = "examples/async_std.rs"
required-features = [
"async",
"proc_macro",
]
[[example]]
name = "basic"
path = "examples/basic.rs"
required-features = [
"time_stores",
"proc_macro",
]
[[example]]
name = "disk"
path = "examples/disk.rs"
required-features = [
"redb_store",
"proc_macro",
]
[[example]]
name = "disk_async"
path = "examples/disk_async.rs"
required-features = [
"redb_store",
"async",
"proc_macro",
]
[[example]]
name = "expires_per_key"
path = "examples/expires_per_key.rs"
required-features = ["proc_macro"]
[[example]]
name = "expiring_sized_cache"
path = "examples/expiring_sized_cache.rs"
required-features = ["time_stores"]
[[example]]
name = "kitchen_sink"
path = "examples/kitchen_sink.rs"
required-features = [
"time_stores",
"proc_macro",
]
[[example]]
name = "redis"
path = "examples/redis.rs"
required-features = [
"redis_store",
"proc_macro",
]
[[example]]
name = "redis-async-async-std"
path = "examples/redis-async-async-std.rs"
required-features = [
"redis_smol_native_tls",
"proc_macro",
]
[[example]]
name = "redis-async-tokio"
path = "examples/redis-async-tokio.rs"
required-features = [
"redis_tokio_native_tls",
"proc_macro",
]
[[example]]
name = "redis-client-side-cache-tokio"
path = "examples/redis-client-side-cache-tokio.rs"
required-features = [
"redis_async_cache",
"redis_tokio_native_tls",
"proc_macro",
]
[[example]]
name = "sharded"
path = "examples/sharded.rs"
required-features = [
"time_stores",
"proc_macro",
]
[[example]]
name = "sharded_expiring"
path = "examples/sharded_expiring.rs"
required-features = ["proc_macro"]
[[example]]
name = "struct_method"
path = "examples/struct_method.rs"
required-features = ["proc_macro"]
[[example]]
name = "tokio"
path = "examples/tokio.rs"
required-features = [
"async",
"proc_macro",
]
[[test]]
name = "cached"
path = "tests/cached.rs"
[[test]]
name = "proc_macro_v3_ui"
path = "tests/proc_macro_v3_ui.rs"
[[test]]
name = "serialize_set_dispatch"
path = "tests/serialize_set_dispatch.rs"
[[test]]
name = "v3_cache_peek_with_expiry_status"
path = "tests/v3_cache_peek_with_expiry_status.rs"
[[test]]
name = "v3_concurrent_evictions_agg"
path = "tests/v3_concurrent_evictions_agg.rs"
[[test]]
name = "v3_custom_hasher_threaded"
path = "tests/v3_custom_hasher_threaded.rs"
[[test]]
name = "v3_force_refresh"
path = "tests/v3_force_refresh.rs"
[[test]]
name = "v3_macros"
path = "tests/v3_macros.rs"
[[test]]
name = "v3_macros_ui"
path = "tests/v3_macros_ui.rs"
[[test]]
name = "v3_per_entry_expiry"
path = "tests/v3_per_entry_expiry.rs"
[[test]]
name = "v3_redis_backward_read"
path = "tests/v3_redis_backward_read.rs"
[[test]]
name = "v3_serialize_set"
path = "tests/v3_serialize_set.rs"
[[test]]
name = "v3_sharded_zero_ttl"
path = "tests/v3_sharded_zero_ttl.rs"
[[test]]
name = "v3_single_owner_zero_ttl"
path = "tests/v3_single_owner_zero_ttl.rs"
[[test]]
name = "v3_traits"
path = "tests/v3_traits.rs"
[[bench]]
name = "cache_benches"
path = "benches/cache_benches.rs"
harness = false
required-features = [
"time_stores",
"proc_macro",
]
[dependencies.ahash]
version = "0.8"
optional = true
default-features = false
[dependencies.async-lock]
version = "3"
optional = true
[dependencies.blocking]
version = "1"
optional = true
[dependencies.cached_proc_macro]
version = "3.0.0-rc.2"
optional = true
[dependencies.cached_proc_macro_types]
version = "3.0.0-rc.2"
optional = true
[dependencies.directories]
version = "6.0"
optional = true
[dependencies.hashbrown]
version = "0.17"
features = ["inline-more"]
default-features = false
[dependencies.parking_lot]
version = "0.12.5"
[dependencies.r2d2]
version = "0.8"
optional = true
[dependencies.redb]
version = "4"
optional = true
[dependencies.redis]
version = "1.0"
features = ["r2d2"]
optional = true
[dependencies.rmp-serde]
version = "1.1"
optional = true
[dependencies.serde]
version = "1.0"
features = ["derive"]
optional = true
[dependencies.serde_json]
version = "1"
optional = true
[dependencies.thiserror]
version = "2"
[dependencies.web-time]
version = "^1.1.0"
[dev-dependencies.async-std]
version = "1.6"
features = ["attributes"]
[dev-dependencies.criterion]
version = "0.8"
[dev-dependencies.futures]
version = "0.3"
[dev-dependencies.googletest]
version = "0.14"
[dev-dependencies.serial_test]
version = "3"
[dev-dependencies.smartstring]
version = "1"
[dev-dependencies.tempfile]
version = "3.10.1"
[dev-dependencies.tokio]
version = "1"
features = [
"macros",
"time",
"sync",
"parking_lot",
"rt",
"rt-multi-thread",
]
[dev-dependencies.trybuild]
version = "1"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.ahash]
version = "0.8"
features = ["runtime-rng"]
optional = true
default-features = false
[lints.rust]
warnings = "deny"