Type Alias ic_certification::HashTree

source ·
pub type HashTree = HashTree<Vec<u8>>;
Expand description

A HashTree representing a full tree.

Aliased Type§

struct HashTree { /* private fields */ }

Implementations§

source§

impl<Storage: AsRef<[u8]>> HashTree<Storage>

source

pub fn digest(&self) -> Sha256Digest

Recomputes root hash of the full tree that this hash tree was constructed from.

source

pub fn lookup_path<P>(&self, path: P) -> LookupResult<'_>where P: IntoIterator, P::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: Clone + AsRef<[u8]>> HashTree<Storage>

source

pub fn lookup_subtree<'p, P, I>(&self, path: P) -> SubtreeLookupResult<Storage>where P: IntoIterator<Item = &'p I>, I: ?Sized + AsRef<[u8]> + 'p,

Given a (verified) tree, the client can fetch the subtree at a given path, which is a sequence of labels (blobs).

source

pub fn list_paths(&self) -> Vec<Vec<Label<Storage>>>

List all paths in the HashTree

Trait Implementations§

source§

impl<Storage: AsRef<[u8]>> AsRef<HashTreeNode<Storage>> for HashTree<Storage>

source§

fn as_ref(&self) -> &HashTreeNode<Storage>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<Storage: Clone + AsRef<[u8]>> Clone for HashTree<Storage>

source§

fn clone(&self) -> HashTree<Storage>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Storage: AsRef<[u8]>> Debug for HashTree<Storage>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

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>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<Storage: PartialEq + AsRef<[u8]>> PartialEq<HashTree<Storage>> for HashTree<Storage>

source§

fn eq(&self, other: &HashTree<Storage>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

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,

Serialize this value into the given Serde serializer. Read more
source§

impl<Storage: Eq + AsRef<[u8]>> Eq for HashTree<Storage>

source§

impl<Storage: AsRef<[u8]>> StructuralEq for HashTree<Storage>

source§

impl<Storage: AsRef<[u8]>> StructuralPartialEq for HashTree<Storage>