pub enum StorageMap {
Sled(SledStorageMap),
Redis(RedisStorageMap),
RedisCluster(RedisStorageMap),
}
Expand description
Unified map implementation enum
Variants§
Sled(SledStorageMap)
Sled map implementation
Redis(RedisStorageMap)
Redis map implementation
RedisCluster(RedisStorageMap)
Redis Cluster map implementation
Trait Implementations§
Source§impl Clone for StorageMap
impl Clone for StorageMap
Source§fn clone(&self) -> StorageMap
fn clone(&self) -> StorageMap
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Map for StorageMap
impl Map for StorageMap
Source§fn insert<'life0, 'life1, 'async_trait, K, V>(
&'life0 self,
key: K,
val: &'life1 V,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn insert<'life0, 'life1, 'async_trait, K, V>( &'life0 self, key: K, val: &'life1 V, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Inserts a key-value pair into the map
Source§fn get<'life0, 'async_trait, K, V>(
&'life0 self,
key: K,
) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + Send + 'async_trait>>
fn get<'life0, 'async_trait, K, V>( &'life0 self, key: K, ) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + Send + 'async_trait>>
Retrieves a value from the map
Source§fn remove<'life0, 'async_trait, K>(
&'life0 self,
key: K,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn remove<'life0, 'async_trait, K>( &'life0 self, key: K, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Removes a key from the map
Source§fn contains_key<'life0, 'async_trait, K>(
&'life0 self,
key: K,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
fn contains_key<'life0, 'async_trait, K>( &'life0 self, key: K, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
Checks if key exists in the map
Source§fn len<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn len<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets number of items in map (requires “map_len” feature)
Source§fn is_empty<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_empty<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks if map is empty
Source§fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clears all entries in the map
Source§fn remove_and_fetch<'life0, 'async_trait, K, V>(
&'life0 self,
key: K,
) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + Send + 'async_trait>>
fn remove_and_fetch<'life0, 'async_trait, K, V>( &'life0 self, key: K, ) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + Send + 'async_trait>>
Removes a key and returns its value
Source§fn remove_with_prefix<'life0, 'async_trait, K>(
&'life0 self,
prefix: K,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn remove_with_prefix<'life0, 'async_trait, K>( &'life0 self, prefix: K, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Removes all keys with given prefix
Source§fn batch_insert<'life0, 'async_trait, V>(
&'life0 self,
key_vals: Vec<(Vec<u8>, V)>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn batch_insert<'life0, 'async_trait, V>( &'life0 self, key_vals: Vec<(Vec<u8>, V)>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Batch insert of key-value pairs
Source§fn batch_remove<'life0, 'async_trait>(
&'life0 self,
keys: Vec<Vec<u8>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn batch_remove<'life0, 'async_trait>(
&'life0 self,
keys: Vec<Vec<u8>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Batch removal of keys
Source§fn iter<'a, 'async_trait, V>(
&'a mut self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncIterator<Item = Result<(Vec<u8>, V)>> + Send + 'a>>> + Send + 'async_trait>>where
V: DeserializeOwned + Sync + Send + 'a + 'static + 'async_trait,
Self: 'async_trait,
'a: 'async_trait,
fn iter<'a, 'async_trait, V>(
&'a mut self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncIterator<Item = Result<(Vec<u8>, V)>> + Send + 'a>>> + Send + 'async_trait>>where
V: DeserializeOwned + Sync + Send + 'a + 'static + 'async_trait,
Self: 'async_trait,
'a: 'async_trait,
Iterates over all key-value pairs
Source§fn key_iter<'a, 'async_trait>(
&'a mut self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncIterator<Item = Result<Vec<u8>>> + Send + 'a>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn key_iter<'a, 'async_trait>(
&'a mut self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncIterator<Item = Result<Vec<u8>>> + Send + 'a>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Iterates over all keys
Source§fn prefix_iter<'a, 'async_trait, P, V>(
&'a mut self,
prefix: P,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncIterator<Item = Result<(Vec<u8>, V)>> + Send + 'a>>> + Send + 'async_trait>>
fn prefix_iter<'a, 'async_trait, P, V>( &'a mut self, prefix: P, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncIterator<Item = Result<(Vec<u8>, V)>> + Send + 'a>>> + Send + 'async_trait>>
Iterates over key-value pairs with given prefix
Source§fn expire_at<'life0, 'async_trait>(
&'life0 self,
at: i64,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn expire_at<'life0, 'async_trait>(
&'life0 self,
at: i64,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets expiration timestamp for the entire map (requires “ttl” feature)
Auto Trait Implementations§
impl Freeze for StorageMap
impl !RefUnwindSafe for StorageMap
impl Send for StorageMap
impl Sync for StorageMap
impl Unpin for StorageMap
impl !UnwindSafe for StorageMap
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