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§
Sourcefn empty_root() -> NamespacedHash
fn empty_root() -> NamespacedHash
Get the hash of the root of an empty Nmt.
Sourcefn from_raw(bytes: &[u8]) -> Result<NamespacedHash>
fn from_raw(bytes: &[u8]) -> Result<NamespacedHash>
Try to decode NamespacedHash from the raw bytes.
Sourcefn to_array(&self) -> RawNamespacedHash
fn to_array(&self) -> RawNamespacedHash
Encode NamespacedHash into array.
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.