pub trait RangeCacheBackend: Send + Sync {
// Required methods
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;
// Provided method
fn disk_stats(&self) -> Option<BackendDiskStats> { ... }
}Required Methods§
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,
Provided Methods§
Sourcefn 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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".