pub struct HashTree<Storage>where
Storage: AsRef<[u8]>,{ /* private fields */ }Expand description
A HashTree representing a full tree.
Implementations§
source§impl<Storage> HashTree<Storage>where
Storage: AsRef<[u8]>,
impl<Storage> HashTree<Storage>where Storage: AsRef<[u8]>,
sourcepub fn digest(&self) -> [u8; 32]
pub fn digest(&self) -> [u8; 32]
Recomputes root hash of the full tree that this hash tree was constructed from.
sourcepub fn lookup_path<P>(&self, path: P) -> LookupResult<'_>where
P: IntoIterator,
<P as IntoIterator>::Item: AsRef<[u8]>,
pub fn lookup_path<P>(&self, path: P) -> LookupResult<'_>where P: IntoIterator, <P as IntoIterator>::Item: AsRef<[u8]>,
Given a (verified) tree, the client can fetch the value at a given path, which is a sequence of labels (blobs).
source§impl<Storage> HashTree<Storage>where
Storage: Clone + AsRef<[u8]>,
impl<Storage> HashTree<Storage>where Storage: Clone + AsRef<[u8]>,
sourcepub fn lookup_subtree<'p, P, I>(&self, path: P) -> SubtreeLookupResult<Storage>where
P: IntoIterator<Item = &'p I>,
I: AsRef<[u8]> + 'p + ?Sized,
pub fn lookup_subtree<'p, P, I>(&self, path: P) -> SubtreeLookupResult<Storage>where P: IntoIterator<Item = &'p I>, I: AsRef<[u8]> + 'p + ?Sized,
Given a (verified) tree, the client can fetch the subtree at a given path, which is a sequence of labels (blobs).
Trait Implementations§
source§impl<Storage> AsRef<HashTreeNode<Storage>> for HashTree<Storage>where
Storage: AsRef<[u8]>,
impl<Storage> AsRef<HashTreeNode<Storage>> for HashTree<Storage>where Storage: AsRef<[u8]>,
source§fn as_ref(&self) -> &HashTreeNode<Storage>
fn as_ref(&self) -> &HashTreeNode<Storage>
Converts this type into a shared reference of the (usually inferred) input type.
source§impl<'de, Storage> Deserialize<'de> for HashTree<Storage>where
Storage: AsRef<[u8]>,
HashTreeNode<Storage>: Deserialize<'de>,
impl<'de, Storage> Deserialize<'de> for HashTree<Storage>where Storage: AsRef<[u8]>, HashTreeNode<Storage>: Deserialize<'de>,
source§fn deserialize<D>(
deserializer: D
) -> Result<HashTree<Storage>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<HashTree<Storage>, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<Storage> From<HashTree<Storage>> for HashTreeNode<Storage>where
Storage: AsRef<[u8]>,
impl<Storage> From<HashTree<Storage>> for HashTreeNode<Storage>where Storage: AsRef<[u8]>,
source§fn from(tree: HashTree<Storage>) -> HashTreeNode<Storage>
fn from(tree: HashTree<Storage>) -> HashTreeNode<Storage>
Converts to this type from the input type.
source§impl<Storage> PartialEq<HashTree<Storage>> for HashTree<Storage>where
Storage: PartialEq<Storage> + AsRef<[u8]>,
impl<Storage> PartialEq<HashTree<Storage>> for HashTree<Storage>where Storage: PartialEq<Storage> + AsRef<[u8]>,
source§impl<Storage> Serialize for HashTree<Storage>where
Storage: AsRef<[u8]>,
impl<Storage> Serialize for HashTree<Storage>where Storage: AsRef<[u8]>,
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<Storage> Eq for HashTree<Storage>where Storage: Eq + AsRef<[u8]>,
impl<Storage> StructuralEq for HashTree<Storage>where Storage: AsRef<[u8]>,
impl<Storage> StructuralPartialEq for HashTree<Storage>where Storage: AsRef<[u8]>,
Auto Trait Implementations§
impl<Storage> RefUnwindSafe for HashTree<Storage>where Storage: RefUnwindSafe,
impl<Storage> Send for HashTree<Storage>where Storage: Send,
impl<Storage> Sync for HashTree<Storage>where Storage: Sync,
impl<Storage> Unpin for HashTree<Storage>where Storage: Unpin,
impl<Storage> UnwindSafe for HashTree<Storage>where Storage: 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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.