TryHash

Trait TryHash 

Source
pub trait TryHash {
    type Error;

    // Required method
    fn try_hash<H: Hasher>(&self, state: &mut H) -> Result<(), Self::Error>;

    // Provided method
    fn try_hash_slice<H: Hasher>(
        data: &[Self],
        state: &mut H,
    ) -> Result<(), Self::Error>
       where Self: Sized { ... }
}
Expand description

The try trait for Hash.

Required Associated Types§

Source

type Error

The type returned in the event of an error.

Required Methods§

Source

fn try_hash<H: Hasher>(&self, state: &mut H) -> Result<(), Self::Error>

The fallible equivalent of Hash::hash.

Provided Methods§

Source

fn try_hash_slice<H: Hasher>( data: &[Self], state: &mut H, ) -> Result<(), Self::Error>
where Self: Sized,

The fallible equivalent of Hash::hash_slice.

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§