pub struct InMemoryStorage { /* private fields */ }Expand description
In-memory storage implementation
Implementations§
Source§impl InMemoryStorage
impl InMemoryStorage
pub fn new() -> Self
pub fn with_config(config: MemoryStorageConfig) -> Self
Trait Implementations§
Source§impl Default for InMemoryStorage
impl Default for InMemoryStorage
Source§impl Storage for InMemoryStorage
impl Storage for InMemoryStorage
Source§fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
entry: &'life2 StorageEntry,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
entry: &'life2 StorageEntry,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store an entry
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = RragResult<Option<StorageEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = RragResult<Option<StorageEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve an entry
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete an entry
Source§fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if an entry exists
Source§fn list_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 StorageQuery,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<StorageKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 StorageQuery,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<StorageKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List keys matching a query
Source§fn get_many<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [StorageKey],
) -> Pin<Box<dyn Future<Output = RragResult<Vec<(StorageKey, Option<StorageEntry>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_many<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [StorageKey],
) -> Pin<Box<dyn Future<Output = RragResult<Vec<(StorageKey, Option<StorageEntry>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Bulk get operation
Source§fn put_many<'life0, 'life1, 'async_trait>(
&'life0 self,
entries: &'life1 [(StorageKey, StorageEntry)],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_many<'life0, 'life1, 'async_trait>(
&'life0 self,
entries: &'life1 [(StorageKey, StorageEntry)],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Bulk put operation
Source§fn delete_many<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [StorageKey],
) -> Pin<Box<dyn Future<Output = RragResult<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_many<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [StorageKey],
) -> Pin<Box<dyn Future<Output = RragResult<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Bulk delete operation
Source§fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clear all entries (optional)
Source§fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<StorageStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<StorageStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get storage statistics
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Health check
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