ProvidesHasher

Trait ProvidesHasher 

Source
pub trait ProvidesHasher {
    type Hasher: BuildHasher;

    // Required method
    fn hasher(&self) -> &Self::Hasher;
}
Expand description

Trait for types which provide a hashing implementation. This is automatically implemented for HashMap and HashSet. It allows the wrapper SumHashes to use the same hashing implementation for elements as is used for the whole hash result.

PRs are welcome to add features for collections from other crates which yield their hashers.

Required Associated Types§

Source

type Hasher: BuildHasher

The type of the hashing implementation

Required Methods§

Source

fn hasher(&self) -> &Self::Hasher

Returns a reference to the used hasher

Implementations on Foreign Types§

Source§

impl<K, V, S> ProvidesHasher for HashMap<K, V, S>
where S: BuildHasher,

Source§

type Hasher = S

Source§

fn hasher(&self) -> &Self::Hasher

Source§

impl<O, S> ProvidesHasher for HashSet<O, S>
where S: BuildHasher,

Source§

type Hasher = S

Source§

fn hasher(&self) -> &Self::Hasher

Implementors§