Skip to main content

HashOrNoHash

Trait HashOrNoHash 

Source
pub trait HashOrNoHash {
    // Required method
    fn hash(data: &[u8]) -> Self;
}
Expand description

HashOrNoHash is implemented for hash types (eg WorkPackageHash) and also NoHash.

NoHash is a unit type, used when we don’t care about the hash in question.

Required Methods§

Source

fn hash(data: &[u8]) -> Self

Returns the hash of data.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§