ouisync::crypto

Trait Hashable

Source
pub trait Hashable {
    // Required method
    fn update_hash<S: Digest>(&self, state: &mut S);

    // Provided methods
    fn update_hash_slice<S>(slice: &[Self], state: &mut S)
       where S: Digest,
             Self: Sized { ... }
    fn hash_with<H>(&self) -> Hash
       where H: Digest<OutputSize = U32> { ... }
    fn hash(&self) -> Hash { ... }
}
Expand description

Similar to std::hash::Hash, but for cryptographic hashes.

Required Methods§

Source

fn update_hash<S: Digest>(&self, state: &mut S)

Provided Methods§

Source

fn update_hash_slice<S>(slice: &[Self], state: &mut S)
where S: Digest, Self: Sized,

Source

fn hash_with<H>(&self) -> Hash
where H: Digest<OutputSize = U32>,

Source

fn hash(&self) -> Hash

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.

Implementations on Foreign Types§

Source§

impl Hashable for u8

Source§

fn update_hash<S: Digest>(&self, state: &mut S)

Source§

fn update_hash_slice<S: Digest>(slice: &[Self], state: &mut S)

Source§

impl Hashable for u32

Source§

fn update_hash<S: Digest>(&self, state: &mut S)

Source§

impl Hashable for u64

Source§

fn update_hash<S: Digest>(&self, state: &mut S)

Source§

impl<K, V> Hashable for BTreeMap<K, V>
where K: Hashable, V: Hashable,

Source§

fn update_hash<S: Digest>(&self, state: &mut S)

Source§

impl<T0: Hashable, T1: Hashable> Hashable for (T0, T1)

Source§

fn update_hash<S: Digest>(&self, state: &mut S)

Source§

impl<T0: Hashable, T1: Hashable, T2: Hashable> Hashable for (T0, T1, T2)

Source§

fn update_hash<S: Digest>(&self, state: &mut S)

Source§

impl<T0: Hashable, T1: Hashable, T2: Hashable, T3: Hashable> Hashable for (T0, T1, T2, T3)

Source§

fn update_hash<S: Digest>(&self, state: &mut S)

Source§

impl<T> Hashable for &T
where T: Hashable + ?Sized,

Source§

fn update_hash<S: Digest>(&self, state: &mut S)

Source§

impl<T> Hashable for [T]
where T: Hashable,

Source§

fn update_hash<S: Digest>(&self, state: &mut S)

Source§

impl<T> Hashable for BTreeSet<T>
where T: Hashable,

Source§

fn update_hash<S: Digest>(&self, state: &mut S)

Source§

impl<T> Hashable for Vec<T>
where T: Hashable,

Source§

fn update_hash<S: Digest>(&self, state: &mut S)

Source§

impl<T, const N: usize> Hashable for [T; N]
where T: Hashable,

Source§

fn update_hash<S: Digest>(&self, state: &mut S)

Implementors§