pub struct InMemoryStorage { /* private fields */ }Expand description
In-memory storage backend (default)
Implementations§
Source§impl InMemoryStorage
impl InMemoryStorage
Sourcepub fn new() -> InMemoryStorage
pub fn new() -> InMemoryStorage
Create a new in-memory storage
Trait Implementations§
Source§impl Clone for InMemoryStorage
impl Clone for InMemoryStorage
Source§fn clone(&self) -> InMemoryStorage
fn clone(&self) -> InMemoryStorage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InMemoryStorage
impl Debug for InMemoryStorage
Source§impl Default for InMemoryStorage
impl Default for InMemoryStorage
Source§fn default() -> InMemoryStorage
fn default() -> InMemoryStorage
Returns the “default value” for a type. Read more
Source§impl Storage for InMemoryStorage
impl Storage for InMemoryStorage
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, PolarisError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStorage: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, PolarisError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStorage: 'async_trait,
Get a value by key
Source§fn set<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), PolarisError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStorage: 'async_trait,
fn set<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), PolarisError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStorage: 'async_trait,
Set a value for a key
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), PolarisError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStorage: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), PolarisError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStorage: 'async_trait,
Delete a key
Auto Trait Implementations§
impl Freeze for InMemoryStorage
impl !RefUnwindSafe for InMemoryStorage
impl Send for InMemoryStorage
impl Sync for InMemoryStorage
impl Unpin for InMemoryStorage
impl !UnwindSafe for InMemoryStorage
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