oxcache 0.4.0

A high-performance multi-level cache library for Rust with L1 (memory) and L2 (Redis) caching.
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"
rust-version = "1.85"
name = "oxcache"
version = "0.4.0"
authors = ["Kirky.X"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "A high-performance multi-level cache library for Rust with L1 (memory) and L2 (Redis) caching."
readme = "README.md"
keywords = [
    "cache",
    "redis",
    "memory",
    "async",
    "performance",
]
categories = [
    "caching",
    "asynchronous",
    "database",
]
license = "MIT"
repository = "https://github.com/Kirky-X/oxcache"
resolver = "2"

[features]
aerospike = ["dep:aerospike"]
batch-write = []
bloom-filter = ["dep:bloomfilter"]
cli = [
    "dep:dashmap",
    "metrics",
]
compression = [
    "dep:flate2",
    "flate2",
]
core = [
    "minimal",
    "redis",
]
default = ["minimal"]
dragonfly = ["redis"]
flate2 = ["dep:flate2"]
full = [
    "core",
    "macros",
    "compression",
    "batch-write",
    "lua-script",
    "cli",
    "testing",
    "dragonfly",
    "aerospike",
]
kit = ["dep:trait-kit"]
lua-script = ["redis"]
macros = [
    "dep:oxcache_macros",
    "minimal",
]
memory = [
    "dep:moka",
    "dep:dashmap",
    "dep:serde",
]
metrics = [
    "serialization",
    "dep:chrono",
    "dep:dashmap",
]
minimal = [
    "memory",
    "tokio/time",
    "metrics",
    "serialization",
    "dep:chrono",
]
redis = [
    "dep:redis",
    "dep:regex",
]
serialization = [
    "dep:serde",
    "dep:serde_json",
    "dep:serde_stacker",
]
testing = []
tracing = []

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

[[test]]
name = "advanced_scenarios_test"
path = "tests/advanced_scenarios_test.rs"

[[test]]
name = "backend_interface_test"
path = "tests/backend_interface_test.rs"

[[test]]
name = "bloom_filter_integration"
path = "tests/bloom_filter_integration.rs"

[[test]]
name = "cache_ttl_expire_test"
path = "tests/cache_ttl_expire_test.rs"

[[test]]
name = "chaos"
path = "tests/chaos.rs"

[[test]]
name = "e2e"
path = "tests/e2e.rs"

[[test]]
name = "feature_core"
path = "tests/feature_core.rs"

[[test]]
name = "feature_minimal"
path = "tests/feature_minimal.rs"

[[test]]
name = "integration"
path = "tests/integration.rs"

[[test]]
name = "macros_skip_cache_write_test"
path = "tests/macros_skip_cache_write_test.rs"

[[test]]
name = "macros_sync_test"
path = "tests/macros_sync_test.rs"

[[test]]
name = "performance"
path = "tests/performance.rs"

[[test]]
name = "redis_sync"
path = "tests/redis_sync.rs"

[[test]]
name = "security"
path = "tests/security.rs"

[[test]]
name = "sync_api_integration"
path = "tests/sync_api_integration.rs"

[[test]]
name = "ttl_consistency_regression"
path = "tests/ttl_consistency_regression.rs"

[[test]]
name = "unit"
path = "tests/unit.rs"

[[bench]]
name = "dashmap_benchmark"
path = "benches/dashmap_benchmark.rs"
harness = false
required-features = ["memory"]

[[bench]]
name = "dragonfly_benchmark"
path = "benches/dragonfly_benchmark.rs"
harness = false
required-features = ["dragonfly"]

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

[[bench]]
name = "redis_benchmark"
path = "benches/redis_benchmark.rs"
harness = false
required-features = ["redis"]

[[bench]]
name = "serialization_benchmark"
path = "benches/serialization_benchmark.rs"
harness = false
required-features = ["serialization"]

[dependencies.aerospike]
version = "2.1"
optional = true

[dependencies.anyhow]
version = "1.0"
optional = true

[dependencies.async-trait]
version = "0.1"

[dependencies.bloomfilter]
version = "3.0"
optional = true

[dependencies.chrono]
version = "0.4"
features = [
    "serde",
    "clock",
]
optional = true
default-features = false

[dependencies.dashmap]
version = "6.2"
optional = true

[dependencies.flate2]
version = "1.1"
optional = true

[dependencies.icu]
version = "2.2"

[dependencies.moka]
version = "0.12"
features = ["future"]
optional = true
default-features = false

[dependencies.once_cell]
version = "1.21"

[dependencies.oxcache_macros]
version = "0.4"
optional = true

[dependencies.redis]
version = "1.5"
features = [
    "aio",
    "tokio-comp",
    "connection-manager",
    "cluster-async",
    "sentinel",
]
optional = true
default-features = false

[dependencies.regex]
version = "1.13"
optional = true

[dependencies.serde]
version = "1.0"
features = ["derive"]
optional = true

[dependencies.serde_json]
version = "1.0"
features = ["unbounded_depth"]
optional = true

[dependencies.serde_stacker]
version = "0.1"
optional = true

[dependencies.tokio]
version = "1.52"
features = [
    "rt",
    "rt-multi-thread",
    "sync",
    "time",
    "macros",
    "bytes",
]
default-features = false

[dependencies.trait-kit]
version = "0.3"
features = ["async"]
optional = true
default-features = false

[dependencies.uuid]
version = "1.23"
features = ["v4"]

[dependencies.writeable]
version = "0.6"

[dev-dependencies.criterion]
version = "0.8"
features = ["async_tokio"]

[dev-dependencies.ctor]
version = "1.0"

[dev-dependencies.rand]
version = "0.10"

[dev-dependencies.serial_test]
version = "4.0"

[dev-dependencies.tempfile]
version = "3.27"

[dev-dependencies.testcontainers]
version = "0.27"

[dev-dependencies.testcontainers-modules]
version = "0.15"
features = ["redis"]

[dev-dependencies.tracing-subscriber]
version = "0.3"
features = [
    "env-filter",
    "fmt",
]
default-features = false

[dev-dependencies.trybuild]
version = "1.0"

[lints.rust]
unexpected_cfgs = "allow"

[profile.bench]
inherits = "release"

[profile.dev]
opt-level = 0
debug = 2
incremental = true

[profile.dev.package.moka]
opt-level = 2

[profile.dev.package.redis]
opt-level = 2

[profile.dev.package.serde]
opt-level = 2

[profile.dev.package.serde_json]
opt-level = 2

[profile.dev.package.tokio]
opt-level = 2

[profile.dev-optimized]
opt-level = 2
debug = 2
inherits = "dev"

[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
panic = "abort"
overflow-checks = false
strip = true

[profile.release.package."*"]
opt-level = 3

[profile.release-with-debug]
debug = 2
inherits = "release"
strip = false

[profile.test]
opt-level = 0
debug = 2