Cargo Features

[dependencies]
moka2 = { version = "0.13.0", default-features = false, features = ["sync", "future", "logging", "unstable-debug-counters", "quanta"] }
default = future, quanta

These default features are set whenever moka2 is added without default-features = false somewhere in the dependency tree.

sync

Enable this feature to use moka::sync::{Cache, SegmentedCache}

Affects moka2::sync, sync_base::PredicateId, moka2::notification, moka2::ops, moka2::policy

future default unstable-debug-counters? = async-lock, event-listener, futures-util

Enable this feature to use moka::future::Cache.

Affects moka2::future, moka2::notification, moka2::ops, moka2::policy

logging = log

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.

unstable-debug-counters = future, once_cell

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.

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

quanta default

Enables quanta

Optional dependencies (enabled by default)

async-lock future

Enables async-lock

Optional dependencies (future)

event-listener future
futures-util future
log logging?

Enables log

Optional dependencies (logging)

once_cell unstable-debug-counters?

Enables once_cell

Optional dependencies (unstable-debug-counters)