pub struct L2DaemonCache { /* private fields */ }Expand description
Daemon-shared cache backed by a concurrent map and ordered eviction index.
Implementations§
Source§impl L2DaemonCache
impl L2DaemonCache
Sourcepub fn new(max_entries: usize, ttl: Duration) -> Self
pub fn new(max_entries: usize, ttl: Duration) -> Self
Creates an empty daemon cache, clamping its capacity to at least one entry.
Sourcepub fn get(&self, key: &CacheKey) -> Option<DeliveryEntryV2>
pub fn get(&self, key: &CacheKey) -> Option<DeliveryEntryV2>
Returns a live entry and refreshes its position in the eviction index.
Sourcepub fn insert(&self, entry: DeliveryEntryV2) -> Option<DeliveryEntryV2>
pub fn insert(&self, entry: DeliveryEntryV2) -> Option<DeliveryEntryV2>
Inserts or replaces an entry, evicting the least-recently-used entry when full.
Sourcepub fn remove(&self, key: &CacheKey) -> Option<DeliveryEntryV2>
pub fn remove(&self, key: &CacheKey) -> Option<DeliveryEntryV2>
Removes an entry and its eviction-index record.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for L2DaemonCache
impl !RefUnwindSafe for L2DaemonCache
impl Send for L2DaemonCache
impl Sync for L2DaemonCache
impl Unpin for L2DaemonCache
impl UnsafeUnpin for L2DaemonCache
impl UnwindSafe for L2DaemonCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more