pub struct Cache<A, K, V, Route>where
A: Address,
Route: DeliveryRoute,
Route::Protocol: Protocol<Addr = A, Msg = CacheResult<K, V>>,{ /* private fields */ }Expand description
Bounded deterministic recency cache behavior.
State is CacheState in least- to most-recent order. Put and successful
get move the key to the most-recent position. Replacement returns the old
value; capacity eviction returns the complete oldest entry. Miss and absent
are factual results, not errors. Every command emits exactly one typed
result after committing its state transition. Initialization is empty, no
actors are created, and the cache never terminates itself. Recency and
eviction are Bombay policy, not durability: Mnesis remains the durable
authority. The standard-library vector is intentional for this initial
deterministic policy; an lru dependency requires a demonstrated scale
need and must remain private. No method has a semantic panic condition.
Implementations§
Source§impl<A, K, V, Route> Cache<A, K, V, Route>where
A: Address,
Route: DeliveryRoute,
Route::Protocol: Protocol<Addr = A, Msg = CacheResult<K, V>>,
impl<A, K, V, Route> Cache<A, K, V, Route>where
A: Address,
Route: DeliveryRoute,
Route::Protocol: Protocol<Addr = A, Msg = CacheResult<K, V>>,
Sourcepub fn new(configuration: CacheConfiguration) -> Self
pub fn new(configuration: CacheConfiguration) -> Self
Bind validated capacity to an empty cache actor.
Sourcepub const fn state(&self) -> &CacheState<K, V>
pub const fn state(&self) -> &CacheState<K, V>
Borrow the complete current recency state.