pub struct MemoryCache { /* private fields */ }Implementations§
Source§impl MemoryCache
impl MemoryCache
pub fn new() -> MemoryCache
pub fn with_max_entries(self, n: usize) -> MemoryCache
pub async fn compact(&self)
pub async fn count(&self) -> usize
Trait Implementations§
Source§impl Default for MemoryCache
impl Default for MemoryCache
Source§fn default() -> MemoryCache
fn default() -> MemoryCache
Returns the “default value” for a type. Read more
Source§impl IDistributedCache for MemoryCache
impl IDistributedCache for MemoryCache
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, CacheError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryCache: 'async_trait,
fn set<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: Vec<u8>,
options: Option<&'life2 DistributedCacheEntryOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryCache: 'async_trait,
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryCache: 'async_trait,
fn refresh<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryCache: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, CacheError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryCache: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
'life0: 'async_trait,
MemoryCache: 'async_trait,
Auto Trait Implementations§
impl !Freeze for MemoryCache
impl !RefUnwindSafe for MemoryCache
impl !UnwindSafe for MemoryCache
impl Send for MemoryCache
impl Sync for MemoryCache
impl Unpin for MemoryCache
impl UnsafeUnpin for MemoryCache
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