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>,
impl<'de, Storage: AsRef<[u8]>> Deserialize<'de> for HashTree<Storage>where
HashTreeNode<Storage>: Deserialize<'de>,
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>
impl<Storage: AsRef<[u8]>> Serialize for HashTree<Storage>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)