pub struct InMemoryDistributedCache { /* private fields */ }Expand description
An in-memory reference DistributedCache — a concurrent map with TTL.
Share one instance between multiple Cache instances (via
Arc) to simulate several nodes pointing at the same L2 within one process.
Implementations§
Trait Implementations§
Source§impl Clone for InMemoryDistributedCache
impl Clone for InMemoryDistributedCache
Source§fn clone(&self) -> InMemoryDistributedCache
fn clone(&self) -> InMemoryDistributedCache
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl DistributedCache for InMemoryDistributedCache
impl DistributedCache for InMemoryDistributedCache
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reads the bytes stored at
key, if present and unexpired. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for InMemoryDistributedCache
impl !UnwindSafe for InMemoryDistributedCache
impl Freeze for InMemoryDistributedCache
impl Send for InMemoryDistributedCache
impl Sync for InMemoryDistributedCache
impl Unpin for InMemoryDistributedCache
impl UnsafeUnpin for InMemoryDistributedCache
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