Trait IsHash

Source
pub trait IsHash:
    Sized
    + AsRef<[u8]>
    + From<Hash>
    + Into<Hash>
    + AsRef<Hash> {
    // Provided methods
    fn as_bytes(&self) -> &[u8; 32] { ... }
    fn as_slice(&self) -> &[u8]  { ... }
    fn as_hash(&self) -> &Hash { ... }
    fn into_bytes(self) -> [u8; 32] { ... }
    fn into_hash(self) -> Hash { ... }
    fn from_bytes(bytes: [u8; 32]) -> Self { ... }
    fn from_hash(hash: Hash) -> Self { ... }
}

Provided Methods§

Source

fn as_bytes(&self) -> &[u8; 32]

Source

fn as_slice(&self) -> &[u8]

Source

fn as_hash(&self) -> &Hash

Source

fn into_bytes(self) -> [u8; 32]

Source

fn into_hash(self) -> Hash

Source

fn from_bytes(bytes: [u8; 32]) -> Self

Source

fn from_hash(hash: Hash) -> Self

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§