pub struct DefaultStore<K, V, const N: usize>where
K: Key<N>,{ /* private fields */ }Implementations§
Source§impl<K, V, const N: usize> DefaultStore<K, V, N>where
K: Key<N>,
impl<K, V, const N: usize> DefaultStore<K, V, N>where
K: Key<N>,
pub fn branches_map(&self) -> &Map<H256, BranchNode<K, N>>
pub fn leaves_map(&self) -> &Map<H256, LeafNode<K, V, N>>
pub fn clear(&mut self)
Trait Implementations§
Source§impl<K, V, const N: usize> BorshDeserialize for DefaultStore<K, V, N>
impl<K, V, const N: usize> BorshDeserialize for DefaultStore<K, V, N>
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl<K, V, const N: usize> BorshSerialize for DefaultStore<K, V, N>
impl<K, V, const N: usize> BorshSerialize for DefaultStore<K, V, N>
Source§impl<K, V: Clone, const N: usize> Clone for DefaultStore<K, V, N>
impl<K, V: Clone, const N: usize> Clone for DefaultStore<K, V, N>
Source§fn clone(&self) -> DefaultStore<K, V, N>
fn clone(&self) -> DefaultStore<K, V, N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<K, V: Clone, const N: usize> Store<K, V, N> for DefaultStore<K, V, N>where
K: Key<N>,
impl<K, V: Clone, const N: usize> Store<K, V, N> for DefaultStore<K, V, N>where
K: Key<N>,
fn get_branch(&self, node: &H256) -> Result<Option<BranchNode<K, N>>, Error>
fn get_leaf(&self, leaf_hash: &H256) -> Result<Option<LeafNode<K, V, N>>, Error>
fn insert_branch( &mut self, node: H256, branch: BranchNode<K, N>, ) -> Result<(), Error>
fn insert_leaf( &mut self, leaf_hash: H256, leaf: LeafNode<K, V, N>, ) -> Result<(), Error>
fn remove_branch(&mut self, node: &H256) -> Result<(), Error>
fn remove_leaf(&mut self, leaf_hash: &H256) -> Result<(), Error>
fn sorted_leaves<'a>(&'a self) -> impl Iterator<Item = (K, &'a V)>where
V: 'a,
fn size(&self) -> usize
Auto Trait Implementations§
impl<K, V, const N: usize> Freeze for DefaultStore<K, V, N>
impl<K, V, const N: usize> RefUnwindSafe for DefaultStore<K, V, N>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V, const N: usize> Send for DefaultStore<K, V, N>
impl<K, V, const N: usize> Sync for DefaultStore<K, V, N>
impl<K, V, const N: usize> Unpin for DefaultStore<K, V, N>
impl<K, V, const N: usize> UnwindSafe for DefaultStore<K, V, N>where
K: UnwindSafe,
V: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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