moka 0.10.4

A fast and concurrent cache library inspired by Java Caffeine
Documentation
[package]
name = "moka"
version = "0.10.4"
edition = "2018"
rust-version = "1.60"  # Released on April 7, 2022, supporting 2021 edition.

description = "A fast and concurrent cache library inspired by Java Caffeine"
license = "MIT OR Apache-2.0"
# homepage = "https://"
documentation = "https://docs.rs/moka/"
repository = "https://github.com/moka-rs/moka"
keywords = ["cache", "concurrent"]
categories = ["caching", "concurrency"]
readme = "README.md"
exclude = [".ci_extras", ".circleci", ".devcontainer", ".github", ".gitpod.yml", ".vscode"]
build = "build.rs"

[features]
default = ["sync", "atomic64", "quanta"]

# This feature is enabled by default. Disable it when you do not need
# `moka::sync::{Cache, SegmentedCache}`
sync = ["crossbeam-epoch", "thiserror", "uuid"]

# Enable this feature to use `moka::future::Cache`.
future = ["crossbeam-epoch", "thiserror", "uuid", "async-io", "async-lock", "futures-util"]

# Removed from "moka" (v0.10.0): `moka::dash::Cache` has been moved to a separate
# crate called "mini-moka" and the module `dash` was renamed to `sync` there. Please
# use `mini_moka::sync::Cache` instead.
# https://docs.rs/mini-moka/latest/mini_moka/sync/struct.Cache.html
# https://crates.io/crates/mini-moka
dash = []

# Enable this feature to activate optional logging from caches.
# Currently cache will emit log only when it encounters a panic in user provided
# callback closure.
logging = ["log"]

# This feature is enabled by default. Disable it when the target platform does not
# support `std::sync::atomic::AtomicU64`. (e.g. `armv5te-unknown-linux-musleabi`
# or `mips-unknown-linux-musl`)
# https://github.com/moka-rs/moka#resolving-compile-errors-on-some-32-bit-platforms
atomic64 = []

# This is an **experimental** feature to make `unsync` and `sync` caches to compile
# for `wasm32-unknown-unknown` target. Note that we have not tested if these caches
# work correctly in wasm32 environment.
js = ["uuid/js"]

# This unstable feature adds `GlobalDebugCounters::current` function, which returns
# counters of internal object construction and destruction. It will have some
# performance impacts and is intended for debugging purpose.
unstable-debug-counters = ["future"]

[dependencies]
crossbeam-channel = "0.5.5"
crossbeam-utils = "0.8"
num_cpus = "1.13"
once_cell = "1.7"
parking_lot = "0.12"
scheduled-thread-pool = "0.2.7"
smallvec = "1.8"
tagptr = "0.2"

# Opt-out serde and stable_deref_trait features
# https://github.com/Manishearth/triomphe/pull/5
triomphe = { version = "0.1.3", default-features = false }

# Optional dependencies (enabled by default)
crossbeam-epoch = { version = "0.9.9", optional = true }
quanta = { version = "0.11.0", optional = true }
thiserror = { version = "1.0", optional = true }
uuid = { version = "1.1", features = ["v4"], optional = true }

# Optional dependencies (future)
async-io = { version = "1.4", optional = true }
async-lock = { version = "2.4", optional = true }
futures-util = { version = "0.3", optional = true }

# Optional dependencies (logging)
log = { version = "0.4", optional = true }

[dev-dependencies]
actix-rt = { version = "2.7", default-features = false }
ahash = "0.8.3"
anyhow = "1.0.19"
async-std = { version = "1.11", features = ["attributes"] }
env_logger = "0.9"
getrandom = "0.2"
paste = "1.0.9"
reqwest = "0.11.11"
skeptic = "0.13"
tokio = { version = "1.19", features = ["fs", "macros", "rt-multi-thread", "sync", "time" ] }

[target.'cfg(trybuild)'.dev-dependencies]
trybuild = "1.0"

[target.'cfg(skeptic)'.build-dependencies]
skeptic = "0.13.5"

[target.'cfg(rustver)'.build-dependencies]
rustc_version = "0.4.0"

# https://docs.rs/about/metadata
[package.metadata.docs.rs]
# Build the doc with some features enabled.
features = ["future"]
rustdoc-args = ["--cfg", "docsrs"]

# ----------------------------------
# RUSTSEC, etc.
#
# crossbeam-channel:
# - Workaround a bug in upstream related to TLS access on AArch64 Linux:
#   - https://github.com/crossbeam-rs/crossbeam/pull/802 (Patched >= 0.5.4)
# - Addressed some stacked borrow violations found by Miri:
#   - https://github.com/crossbeam-rs/crossbeam/blob/master/crossbeam-channel/CHANGELOG.md#version-052 (Patched >= 0.5.2)
#
# smallvec:
# - https://rustsec.org/advisories/RUSTSEC-2021-0003.html (Patched >= 1.6.1)
#
# Tokio:
# - https://rustsec.org/advisories/RUSTSEC-2021-0124.html (Patched >= 1.13.1)
# - https://rustsec.org/advisories/RUSTSEC-2021-0072.html (Patched >= 1.8.1)