pub struct InMemoryState(/* private fields */);Expand description
A simple in-memory KvState implementation backed by a HashMap with snapshot/restore.
Trait Implementations§
Source§impl Clone for InMemoryState
impl Clone for InMemoryState
Source§fn clone(&self) -> InMemoryState
fn clone(&self) -> InMemoryState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for InMemoryState
impl Default for InMemoryState
Source§impl KvState for InMemoryState
impl KvState for InMemoryState
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
value: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn iter_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 [u8]>,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Vec<u8>, Vec<u8>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn iter_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 [u8]>,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Vec<u8>, Vec<u8>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns all key/value pairs, optionally filtered by a prefix.
Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryState
impl !UnwindSafe for InMemoryState
impl Freeze for InMemoryState
impl Send for InMemoryState
impl Sync for InMemoryState
impl Unpin for InMemoryState
impl UnsafeUnpin for InMemoryState
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