HashTree

Enum HashTree 

Source
pub enum HashTree<'a> {
    Empty,
    Fork(Box<ForkInner<'a>>),
    Labeled(Cow<'a, [u8]>, Box<HashTree<'a>>),
    Leaf(Cow<'a, [u8]>),
    Pruned(Hash),
}
Expand description

HashTree as defined in the interfaces spec. https://sdk.dfinity.org/docs/interface-spec/index.html#_certificate

Variants§

§

Empty

§

Fork(Box<ForkInner<'a>>)

§

Labeled(Cow<'a, [u8]>, Box<HashTree<'a>>)

§

Leaf(Cow<'a, [u8]>)

§

Pruned(Hash)

Implementations§

Source§

impl<'a> HashTree<'a>

Source

pub fn reconstruct(&self) -> Hash

Source

pub fn get_labels<'b: 'a>(&'b self) -> Vec<&'b [u8]>

Collect and return all of the labels in this HashTree.

This method is intended for testing purposes.

Source

pub fn get_leaf_values<'b: 'a>(&'b self) -> Vec<&'b [u8]>

Collect and return all of the values in this HashTree.

This method is intended for testing purposes.

Trait Implementations§

Source§

impl<'a> Debug for HashTree<'a>

Source§

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

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

impl<'a> PartialEq for HashTree<'a>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for HashTree<'_>

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<'a> Eq for HashTree<'a>

Source§

impl<'a> StructuralPartialEq for HashTree<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for HashTree<'a>

§

impl<'a> RefUnwindSafe for HashTree<'a>

§

impl<'a> Send for HashTree<'a>

§

impl<'a> Sync for HashTree<'a>

§

impl<'a> Unpin for HashTree<'a>

§

impl<'a> UnwindSafe for HashTree<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.