pub struct BoundedMemoryBackend { /* private fields */ }Expand description
A byte-weighted, sharded, in-memory RangeCacheBackend bounded to a fixed
capacity, built on the standalone foyer-memory crate’s Cache – not the
umbrella foyer crate (which FoyerBackend uses via HybridCache, and
which transitively pulls in a disk-backed storage engine). foyer-memory
is the same in-memory engine HybridCache uses internally for its RAM
tier, so this reuses that eviction implementation without the disk-IO
dependencies, via LfuConfig rather than FoyerBackend’s LruConfig.
Used as the shared RAM budget backing the in-process L1 cache
(l1_store.rs).
Implementations§
Trait Implementations§
Source§impl RangeCacheBackend for BoundedMemoryBackend
impl RangeCacheBackend for BoundedMemoryBackend
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
key: String,
value: Bytes,
_hint: FillHint,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn disk_stats(&self) -> Option<BackendDiskStats>
fn disk_stats(&self) -> Option<BackendDiskStats>
Disk write-path counters, for the saturation monitor’s per-second
gauges. Defaulted to
None so backends without a disk tier (e.g.
MemoryBackend) need no override.Auto Trait Implementations§
impl !RefUnwindSafe for BoundedMemoryBackend
impl !UnwindSafe for BoundedMemoryBackend
impl Freeze for BoundedMemoryBackend
impl Send for BoundedMemoryBackend
impl Sync for BoundedMemoryBackend
impl Unpin for BoundedMemoryBackend
impl UnsafeUnpin for BoundedMemoryBackend
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
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