pub struct InMemoryBaseStore<V>{ /* private fields */ }Expand description
In-memory implementation of the BaseStore using a dictionary.
This implementation uses an Arc<RwLock<HashMap>> internally to allow
for concurrent access and mutation.
Implementations§
Trait Implementations§
Source§impl<V> BaseStore<String, V> for InMemoryBaseStore<V>
impl<V> BaseStore<String, V> for InMemoryBaseStore<V>
Source§fn mget(&self, keys: &[String]) -> Vec<Option<V>>
fn mget(&self, keys: &[String]) -> Vec<Option<V>>
Get the values associated with the given keys. Read more
Source§fn amget<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Vec<Option<V>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn amget<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Vec<Option<V>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Async get the values associated with the given keys. Read more
Source§fn amset<'life0, 'life1, 'async_trait>(
&'life0 self,
key_value_pairs: &'life1 [(String, V)],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn amset<'life0, 'life1, 'async_trait>(
&'life0 self,
key_value_pairs: &'life1 [(String, V)],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Async set the values for the given keys. Read more
Source§fn mdelete(&self, keys: &[String])
fn mdelete(&self, keys: &[String])
Delete the given keys and their associated values. Read more
Source§fn amdelete<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [String],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn amdelete<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [String],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Async delete the given keys and their associated values. Read more
Source§fn yield_keys(&self, prefix: Option<&str>) -> Vec<String>
fn yield_keys(&self, prefix: Option<&str>) -> Vec<String>
Get an iterator over keys that match the given prefix. Read more
Source§fn ayield_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn ayield_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Async get an iterator over keys that match the given prefix. Read more
Auto Trait Implementations§
impl<V> Freeze for InMemoryBaseStore<V>
impl<V> !RefUnwindSafe for InMemoryBaseStore<V>
impl<V> Send for InMemoryBaseStore<V>
impl<V> Sync for InMemoryBaseStore<V>
impl<V> Unpin for InMemoryBaseStore<V>
impl<V> !UnwindSafe for InMemoryBaseStore<V>
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