pub enum SwrRead<T> {
Fresh(T),
Stale(T, SwrToken),
Miss,
}Expand description
Outcome of an SWR-aware typed read — see CacheKit::interop_get_swr.
Variants§
Fresh(T)
Cache hit within the freshness window (or an L2 hit): use directly.
Stale(T, SwrToken)
L1 hit past the freshness threshold but before hard expiry: use the
value now, and schedule a background refresh (the #[cachekit] macro
does this via CacheKit::single_flight + re-execution). The token
makes refresh completion conditional: a newer set or delete wins.
Miss
No usable entry: fall through to a normal blocking miss + fill.
Trait Implementations§
impl<T: PartialEq> StructuralPartialEq for SwrRead<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for SwrRead<T>
impl<T> !UnwindSafe for SwrRead<T>
impl<T> Freeze for SwrRead<T>where
T: Freeze,
impl<T> Send for SwrRead<T>where
T: Send,
impl<T> Sync for SwrRead<T>where
T: Sync,
impl<T> Unpin for SwrRead<T>where
T: Unpin,
impl<T> UnsafeUnpin for SwrRead<T>where
T: UnsafeUnpin,
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