pub struct InMemoryNodeStorage<const N: usize> { /* private fields */ }Expand description
An implementation of NodeStorage that stores nodes in a HashMap.
§Type Parameters
N: The size of the value digest.
Implementations§
Trait Implementations§
Source§impl<const N: usize> Clone for InMemoryNodeStorage<N>
impl<const N: usize> Clone for InMemoryNodeStorage<N>
Source§impl<const N: usize> Debug for InMemoryNodeStorage<N>
impl<const N: usize> Debug for InMemoryNodeStorage<N>
Source§impl<const N: usize> Default for InMemoryNodeStorage<N>
impl<const N: usize> Default for InMemoryNodeStorage<N>
Source§impl<const N: usize> NodeStorage<N> for InMemoryNodeStorage<N>
impl<const N: usize> NodeStorage<N> for InMemoryNodeStorage<N>
Source§fn get_node_by_hash(&self, hash: &ValueDigest<N>) -> Option<ProllyNode<N>>
fn get_node_by_hash(&self, hash: &ValueDigest<N>) -> Option<ProllyNode<N>>
Retrieves a node from storage by its hash. Read more
Source§fn insert_node(
&mut self,
hash: ValueDigest<N>,
node: ProllyNode<N>,
) -> Option<()>
fn insert_node( &mut self, hash: ValueDigest<N>, node: ProllyNode<N>, ) -> Option<()>
Inserts a node into storage. Read more
Source§fn delete_node(&mut self, hash: &ValueDigest<N>) -> Option<()>
fn delete_node(&mut self, hash: &ValueDigest<N>) -> Option<()>
Deletes a node from storage by its hash. Read more
fn save_config(&self, key: &str, config: &[u8])
fn get_config(&self, key: &str) -> Option<Vec<u8>>
Auto Trait Implementations§
impl<const N: usize> !Freeze for InMemoryNodeStorage<N>
impl<const N: usize> RefUnwindSafe for InMemoryNodeStorage<N>
impl<const N: usize> Send for InMemoryNodeStorage<N>
impl<const N: usize> Sync for InMemoryNodeStorage<N>
impl<const N: usize> Unpin for InMemoryNodeStorage<N>
impl<const N: usize> UnwindSafe for InMemoryNodeStorage<N>
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