//! The pluggable cache backend.
use Duration;
use crateResult;
use crateBoxFuture;
/// A cache backend that stores opaque byte values under string keys.
///
/// The [`Cache`](crate::Cache) handle serializes typed values to bytes and talks
/// to a store through this trait, so any backend (in-memory, Redis) works the same
/// from a handler's point of view. The trait is object-safe: a [`Cache`] holds an
/// `Arc<dyn CacheStore>`.
///
/// TTL convention: `None` keeps the entry until the store evicts it (no explicit
/// expiry); `Some(duration)` expires the entry after `duration`. A zero duration
/// is normalized to `None` ("never expire") by the [`Cache`](crate::Cache) handle
/// before it reaches the store.