pub struct HashTree<Storage: AsRef<[u8]>> { /* private fields */ }
Expand description
A HashTree representing a full tree.
Implementations§
Source§impl<Storage: AsRef<[u8]>> HashTree<Storage>
impl<Storage: AsRef<[u8]>> HashTree<Storage>
Sourcepub fn digest(&self) -> Hash
pub fn digest(&self) -> Hash
Recomputes root hash of the full tree that this hash tree was constructed from.
Sourcepub fn lookup_path<P>(&self, path: P) -> LookupResult<'_>
pub fn lookup_path<P>(&self, path: P) -> LookupResult<'_>
Given a (verified) tree, the client can fetch the value at a given path, which is a sequence of labels (blobs).
Source§impl<Storage: Clone + AsRef<[u8]>> HashTree<Storage>
impl<Storage: Clone + AsRef<[u8]>> HashTree<Storage>
Sourcepub fn lookup_subtree<'p, P, I>(&self, path: P) -> SubtreeLookupResult<Storage>
pub fn lookup_subtree<'p, P, I>(&self, path: P) -> SubtreeLookupResult<Storage>
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<[u8]>> AsRef<HashTreeNode<Storage>> for HashTree<Storage>
impl<Storage: AsRef<[u8]>> AsRef<HashTreeNode<Storage>> for HashTree<Storage>
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: AsRef<[u8]>> Deserialize<'de> for HashTree<Storage>where
HashTreeNode<Storage>: Deserialize<'de>,
Available on crate feature serde
only.
impl<'de, Storage: AsRef<[u8]>> Deserialize<'de> for HashTree<Storage>where
HashTreeNode<Storage>: Deserialize<'de>,
Available on crate feature
serde
only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<Storage: AsRef<[u8]>> From<HashTree<Storage>> for HashTreeNode<Storage>
impl<Storage: AsRef<[u8]>> From<HashTree<Storage>> for HashTreeNode<Storage>
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: AsRef<[u8]>> Serialize for HashTree<Storage>
Available on crate feature serde
only.
impl<Storage: AsRef<[u8]>> Serialize for HashTree<Storage>
Available on crate feature
serde
only.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 + AsRef<[u8]>> Eq for HashTree<Storage>
impl<Storage: AsRef<[u8]>> StructuralPartialEq for HashTree<Storage>
Auto Trait Implementations§
impl<Storage> Freeze for HashTree<Storage>where
Storage: Freeze,
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