Skip to main content

CanonicalSerializeHashExt

Trait CanonicalSerializeHashExt 

Source
pub trait CanonicalSerializeHashExt: CanonicalSerialize {
    // Provided methods
    fn hash<H: Digest>(&self) -> Output<H> { ... }
    fn hash_uncompressed<H: Digest>(&self) -> Output<H> { ... }
}
Expand description

CanonicalSerialize induces a natural way to hash a value: serialize it and hash the resulting byte string.

This is a convenience trait that combines the two steps.

Provided Methods§

Source

fn hash<H: Digest>(&self) -> Output<H>

Source

fn hash_uncompressed<H: Digest>(&self) -> Output<H>

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§

Source§

impl<T: CanonicalSerialize> CanonicalSerializeHashExt for T

CanonicalSerializeHashExt is a (blanket) extension trait of CanonicalSerialize: all types implementing the latter automatically implement the former.