pub struct NestedMemoryMap<M, K, V>where
M: Copy + Clone + PartialEq + Eq + Hash + Serialize + for<'de> Deserialize<'de> + Send + Sync,
K: Clone + PartialEq + Eq + Serialize + for<'de> Deserialize<'de> + Send + Sync,
V: Clone + PartialEq + Eq + Serialize + for<'de> Deserialize<'de> + Send + Sync,{ /* private fields */ }Trait Implementations§
Source§impl<M, K, V> Clone for NestedMemoryMap<M, K, V>
impl<M, K, V> Clone for NestedMemoryMap<M, K, V>
Source§fn clone(&self) -> NestedMemoryMap<M, K, V>
fn clone(&self) -> NestedMemoryMap<M, K, V>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<M, K, V> Default for NestedMemoryMap<M, K, V>
impl<M, K, V> Default for NestedMemoryMap<M, K, V>
Source§fn default() -> NestedMemoryMap<M, K, V>
fn default() -> NestedMemoryMap<M, K, V>
Source§impl<M, K, V> FromIterator<(M, K, V)> for NestedMemoryMap<M, K, V>
impl<M, K, V> FromIterator<(M, K, V)> for NestedMemoryMap<M, K, V>
Source§fn from_iter<I>(iter: I) -> NestedMemoryMap<M, K, V>where
I: IntoIterator<Item = (M, K, V)>,
fn from_iter<I>(iter: I) -> NestedMemoryMap<M, K, V>where
I: IntoIterator<Item = (M, K, V)>,
Initializes a new NestedMemoryMap from the given iterator.
Source§impl<'a, M, K, V> NestedMap<'a, M, K, V> for NestedMemoryMap<M, K, V>
impl<'a, M, K, V> NestedMap<'a, M, K, V> for NestedMemoryMap<M, K, V>
Source§fn insert(&self, map: M, key: K, value: V) -> Result<(), Error>
fn insert(&self, map: M, key: K, value: V) -> Result<(), Error>
Inserts the given map-key-value pair.
Source§fn remove_key(&self, map: &M, key: &K) -> Result<(), Error>
fn remove_key(&self, map: &M, key: &K) -> Result<(), Error>
Removes the key-value pair for the given map and key.
Source§fn start_atomic(&self)
fn start_atomic(&self)
Begins an atomic operation. Any further calls to insert and remove will be queued
without an actual write taking place until finish_atomic is called.
Source§fn is_atomic_in_progress(&self) -> bool
fn is_atomic_in_progress(&self) -> bool
Checks whether an atomic operation is currently in progress. This can be done to ensure that lower-level operations don’t start and finish their individual atomic write batch if they are already part of a larger one.
Source§fn atomic_checkpoint(&self)
fn atomic_checkpoint(&self)
Saves the current list of pending operations, so that if atomic_rewind is called,
we roll back all future operations, and return to the start of this checkpoint.
Source§fn clear_latest_checkpoint(&self)
fn clear_latest_checkpoint(&self)
Removes the latest atomic checkpoint.
Source§fn atomic_rewind(&self)
fn atomic_rewind(&self)
Removes all pending operations to the last atomic_checkpoint
(or to start_atomic if no checkpoints have been created).
Source§fn abort_atomic(&self)
fn abort_atomic(&self)
Aborts the current atomic operation.
Source§impl<'a, M, K, V> NestedMapRead<'a, M, K, V> for NestedMemoryMap<M, K, V>
impl<'a, M, K, V> NestedMapRead<'a, M, K, V> for NestedMemoryMap<M, K, V>
Source§fn contains_key_confirmed(&self, map: &M, key: &K) -> Result<bool, Error>
fn contains_key_confirmed(&self, map: &M, key: &K) -> Result<bool, Error>
Returns true if the given key exists in the map.
Source§fn contains_key_speculative(&self, map: &M, key: &K) -> Result<bool, Error>
fn contains_key_speculative(&self, map: &M, key: &K) -> Result<bool, Error>
Returns true if the given key exists in the map.
This method first checks the atomic batch, and if it does not exist, then checks the map.
Source§fn get_map_confirmed(&'a self, map: &M) -> Result<Vec<(K, V)>, Error>
fn get_map_confirmed(&'a self, map: &M) -> Result<Vec<(K, V)>, Error>
Returns the confirmed key-value pairs for the given map, if it exists.
Source§fn get_map_speculative(&'a self, map: &M) -> Result<Vec<(K, V)>, Error>
fn get_map_speculative(&'a self, map: &M) -> Result<Vec<(K, V)>, Error>
Returns the speculative key-value pairs for the given map, if it exists.
Source§fn get_value_confirmed(
&'a self,
map: &M,
key: &K,
) -> Result<Option<Cow<'a, V>>, Error>
fn get_value_confirmed( &'a self, map: &M, key: &K, ) -> Result<Option<Cow<'a, V>>, Error>
Returns the value for the given key from the map, if it exists.
Source§fn get_value_pending(&self, map: &M, key: &K) -> Option<Option<V>>
fn get_value_pending(&self, map: &M, key: &K) -> Option<Option<V>>
Returns the current value for the given key if it is scheduled to be inserted as part of an atomic batch.
If the key does not exist, returns None.
If the key is removed in the batch, returns Some(None).
If the key is inserted in the batch, returns Some(Some(value)).
Source§fn iter_pending(
&'a self,
) -> <NestedMemoryMap<M, K, V> as NestedMapRead<'a, M, K, V>>::PendingIterator
fn iter_pending( &'a self, ) -> <NestedMemoryMap<M, K, V> as NestedMapRead<'a, M, K, V>>::PendingIterator
Returns an iterator visiting each map-key-value pair in the atomic batch.
Source§fn iter_confirmed(
&'a self,
) -> <NestedMemoryMap<M, K, V> as NestedMapRead<'a, M, K, V>>::Iterator
fn iter_confirmed( &'a self, ) -> <NestedMemoryMap<M, K, V> as NestedMapRead<'a, M, K, V>>::Iterator
Returns an iterator visiting each confirmed map-key-value pair.
Source§fn keys_confirmed(
&'a self,
) -> <NestedMemoryMap<M, K, V> as NestedMapRead<'a, M, K, V>>::Keys
fn keys_confirmed( &'a self, ) -> <NestedMemoryMap<M, K, V> as NestedMapRead<'a, M, K, V>>::Keys
Returns an iterator over each confirmed key.
Source§fn values_confirmed(
&'a self,
) -> <NestedMemoryMap<M, K, V> as NestedMapRead<'a, M, K, V>>::Values
fn values_confirmed( &'a self, ) -> <NestedMemoryMap<M, K, V> as NestedMapRead<'a, M, K, V>>::Values
Returns an iterator over each confirmed value.
type Iterator = IntoIter<(Cow<'a, M>, Cow<'a, K>, Cow<'a, V>)>
type Keys = IntoIter<(Cow<'a, M>, Cow<'a, K>)>
type PendingIterator = Map<IntoIter<(M, Option<K>, Option<V>)>, fn((M, Option<K>, Option<V>)) -> (Cow<'a, M>, Option<Cow<'a, K>>, Option<Cow<'a, V>>)>
type Values = Map<IntoValues<Vec<u8>, V>, fn(V) -> Cow<'a, V>>
Auto Trait Implementations§
impl<M, K, V> Freeze for NestedMemoryMap<M, K, V>
impl<M, K, V> !RefUnwindSafe for NestedMemoryMap<M, K, V>
impl<M, K, V> Send for NestedMemoryMap<M, K, V>
impl<M, K, V> Sync for NestedMemoryMap<M, K, V>
impl<M, K, V> Unpin for NestedMemoryMap<M, K, V>
impl<M, K, V> !UnwindSafe for NestedMemoryMap<M, K, 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more