pub struct MemoryBackend { /* private fields */ }Expand description
Separate in-memory backend that stores wire-envelope bytes.
This backend is not a replacement for L1; it exists to test the
CacheBackend path without a Redis or filesystem dependency. It does not
publish invalidation streams, so it should not be used as a coherence test
double for distributed invalidation behavior.
Trait Implementations§
Source§impl<T> CacheBackend<T> for MemoryBackend
impl<T> CacheBackend<T> for MemoryBackend
Source§fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
keyspace: &'life1 BackendKeyspace,
id: &'life2 T::Id,
) -> Pin<Box<dyn Future<Output = Result<Option<T>, BackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
keyspace: &'life1 BackendKeyspace,
id: &'life2 T::Id,
) -> Pin<Box<dyn Future<Output = Result<Option<T>, BackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Read an entry from the backend.
Source§fn put<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
keyspace: &'life1 BackendKeyspace,
id: &'life2 T::Id,
value: &'life3 T,
ttl: Option<Duration>,
) -> Pin<Box<dyn Future<Output = Result<(), BackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn put<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
keyspace: &'life1 BackendKeyspace,
id: &'life2 T::Id,
value: &'life3 T,
ttl: Option<Duration>,
) -> Pin<Box<dyn Future<Output = Result<(), BackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Store an entry in the backend.
Source§fn invalidate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
keyspace: &'life1 BackendKeyspace,
id: &'life2 T::Id,
) -> Pin<Box<dyn Future<Output = Result<(), BackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn invalidate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
keyspace: &'life1 BackendKeyspace,
id: &'life2 T::Id,
) -> Pin<Box<dyn Future<Output = Result<(), BackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Invalidate one backend entry and publish an id-scoped invalidation if supported.
Source§fn invalidate_all<'life0, 'life1, 'async_trait>(
&'life0 self,
keyspace: &'life1 BackendKeyspace,
) -> Pin<Box<dyn Future<Output = Result<(), BackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn invalidate_all<'life0, 'life1, 'async_trait>(
&'life0 self,
keyspace: &'life1 BackendKeyspace,
) -> Pin<Box<dyn Future<Output = Result<(), BackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Invalidate backend entries in this keyspace and publish an all-scoped
invalidation if supported. Read more
Source§fn invalidation_stream(
&self,
_keyspace: BackendKeyspace,
) -> BackendInvalidationStream<T::Id>
fn invalidation_stream( &self, _keyspace: BackendKeyspace, ) -> BackendInvalidationStream<T::Id>
Subscribe to backend invalidations for one keyspace.
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
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§
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