pub struct MemoryBackend { /* private fields */ }Implementations§
Source§impl MemoryBackend
impl MemoryBackend
pub fn new() -> MemoryBackend
Trait Implementations§
Source§impl Default for MemoryBackend
impl Default for MemoryBackend
Source§fn default() -> MemoryBackend
fn default() -> MemoryBackend
Returns the “default value” for a type. Read more
Source§impl RangeCacheBackend for MemoryBackend
impl RangeCacheBackend for MemoryBackend
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
_expected_len: u64,
) -> Pin<Box<dyn Future<Output = Option<Bytes>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryBackend: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
_expected_len: u64,
) -> Pin<Box<dyn Future<Output = Option<Bytes>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryBackend: 'async_trait,
expected_len is the exact length the caller will accept for key.
A backend MUST NOT copy a value whose length differs into any faster
tier it maintains (the promotion gate) and MUST treat such a value as
a miss. Single-tier backends accept and ignore the parameter.Source§fn put<'life0, 'async_trait>(
&'life0 self,
key: String,
value: Bytes,
_hint: FillHint,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
MemoryBackend: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
key: String,
value: Bytes,
_hint: FillHint,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
MemoryBackend: 'async_trait,
value is an owned buffer, not a view into a larger one (e.g. a slice
of a coalesced multi-block origin GET): range_cache::fetch copies
each block once before calling put, specifically so no cached (or
in-flight-write) value pins a larger parent allocation alive. A
backend may therefore store value as-is; it must not assume it needs
its own defensive copy to detach from a parent buffer.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.Source§fn ram_usage_bytes(&self) -> Option<usize>
fn ram_usage_bytes(&self) -> Option<usize>
Accounted RAM-tier byte usage, for the saturation monitor’s residency
gauge.
None for backends with no RAM tier accounting (e.g.
MemoryBackend). Divergence between this and process RSS is the
signature of a cached value pinning more than its accounted weight.Source§fn ram_entries(&self) -> Option<usize>
fn ram_entries(&self) -> Option<usize>
Accounted RAM-tier entry count, the entry-count sibling to
ram_usage_bytes. None for backends with no RAM tier accounting
(e.g. MemoryBackend).Auto Trait Implementations§
impl !Freeze for MemoryBackend
impl RefUnwindSafe for MemoryBackend
impl Send for MemoryBackend
impl Sync for MemoryBackend
impl Unpin for MemoryBackend
impl UnsafeUnpin for MemoryBackend
impl UnwindSafe for MemoryBackend
Blanket Implementations§
impl<T> Allocation for T
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<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].