pub struct MemoryCacheAdapter { /* private fields */ }Expand description
In-memory cache adapter for testing and development
Implementations§
Source§impl MemoryCacheAdapter
impl MemoryCacheAdapter
pub fn new() -> MemoryCacheAdapter
Trait Implementations§
Source§impl CacheAdapter for MemoryCacheAdapter
impl CacheAdapter for MemoryCacheAdapter
Source§fn set<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: &'life2 str,
expires_in: TimeDelta,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryCacheAdapter: 'async_trait,
fn set<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: &'life2 str,
expires_in: TimeDelta,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryCacheAdapter: 'async_trait,
Set a value with expiration
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryCacheAdapter: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryCacheAdapter: 'async_trait,
Get a value by key
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryCacheAdapter: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryCacheAdapter: 'async_trait,
Delete a value by key
Source§fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryCacheAdapter: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryCacheAdapter: 'async_trait,
Check if key exists
Source§impl Default for MemoryCacheAdapter
impl Default for MemoryCacheAdapter
Source§fn default() -> MemoryCacheAdapter
fn default() -> MemoryCacheAdapter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryCacheAdapter
impl RefUnwindSafe for MemoryCacheAdapter
impl Send for MemoryCacheAdapter
impl Sync for MemoryCacheAdapter
impl Unpin for MemoryCacheAdapter
impl UnwindSafe for MemoryCacheAdapter
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