Struct MemVersionedStateStore
pub struct MemVersionedStateStore<V: VersionIdentifier>(/* private fields */);Expand description
Memory-implemented (volatile) VersionedStateStore for testing/debugging purpose.
Implementations§
§impl<V: VersionIdentifier> MemVersionedStateStore<V>
impl<V: VersionIdentifier> MemVersionedStateStore<V>
pub fn new() -> Self
Trait Implementations§
§impl<V: VersionIdentifier> VersionedStateStore<V> for MemVersionedStateStore<V>
impl<V: VersionIdentifier> VersionedStateStore<V> for MemVersionedStateStore<V>
§fn atomic_write<'a>(
&'a self,
base: Option<&V>,
version_id: &V,
changes: Box<dyn Iterator<Item = (Key, Option<Value>)> + 'a>,
) -> Result<(), VersionedStateStoreError>
fn atomic_write<'a>( &'a self, base: Option<&V>, version_id: &V, changes: Box<dyn Iterator<Item = (Key, Option<Value>)> + 'a>, ) -> Result<(), VersionedStateStoreError>
Atomically apply a list of changes described by the iterator to the state of the
base
version, saved in the new version. Also set the latest version to version. For each
iterated item, a None value will remove the value if it exists.§impl<V: VersionIdentifier> VersionedStateStoreR<V> for MemVersionedStateStore<V>
impl<V: VersionIdentifier> VersionedStateStoreR<V> for MemVersionedStateStore<V>
fn debug_iter<'a>( &'a self, version_id: &V, ) -> Box<dyn Iterator<Item = (Key, Value)> + 'a>
§fn get(&self, version_id: &V, key: Key) -> Option<Value>
fn get(&self, version_id: &V, key: Key) -> Option<Value>
Retrieve the value for a particular version given a key. Returns
None if not exists.§fn get_all(&self, version_id: &V, key_prefix: Key) -> HashMap<Key, Value>
fn get_all(&self, version_id: &V, key_prefix: Key) -> HashMap<Key, Value>
Retrieve all the values for a given key prefix in a given version.
HashMap is empty if no such version or key prefix not exists.
§fn latest_version_id(&self) -> Option<V>
fn latest_version_id(&self) -> Option<V>
Obtain the latest version identifier that has been successfully written.
fn contains(&self, version_id: &V, key: Key) -> bool
Auto Trait Implementations§
impl<V> !Freeze for MemVersionedStateStore<V>
impl<V> !RefUnwindSafe for MemVersionedStateStore<V>
impl<V> Send for MemVersionedStateStore<V>
impl<V> Sync for MemVersionedStateStore<V>
impl<V> Unpin for MemVersionedStateStore<V>where
V: Unpin,
impl<V> !UnwindSafe for MemVersionedStateStore<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