NamespacedHashExt

Trait NamespacedHashExt 

Source
pub trait NamespacedHashExt {
    // Required methods
    fn empty_root() -> NamespacedHash;
    fn from_raw(bytes: &[u8]) -> Result<NamespacedHash>;
    fn to_vec(&self) -> Vec<u8> ;
    fn to_array(&self) -> RawNamespacedHash;
    fn validate_namespace_order(&self) -> Result<()>;
}
Expand description

An extention trait for the NamespacedHash to perform additional actions.

Required Methods§

Source

fn empty_root() -> NamespacedHash

Get the hash of the root of an empty Nmt.

Source

fn from_raw(bytes: &[u8]) -> Result<NamespacedHash>

Try to decode NamespacedHash from the raw bytes.

Source

fn to_vec(&self) -> Vec<u8>

Encode NamespacedHash into Vec.

Source

fn to_array(&self) -> RawNamespacedHash

Encode NamespacedHash into array.

Source

fn validate_namespace_order(&self) -> Result<()>

Validate if the Namespaces covered by this hash are in correct order.

I.e. this verifies that the minimum Namespace of this hash is lower or equal to the maximum Namespace.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§