[][src]Trait ahash::CallHasher

pub trait CallHasher: Hash {
    fn get_hash<H: Hasher>(&self, hasher: H) -> u64;
}

Provides a way to get an optimized hasher for a given data type. Rather than using a Hasher generically which can hash any value, this provides a way to get a specialized hash for a specific type. So this may be faster for primitive types. It does however consume the hasher in the process. #Example

use std::hash::BuildHasher;
use ahash::RandomState;
use ahash::CallHasher;

let hash_builder = RandomState::new();
//...
let value = 17;
let hash = value.get_hash(hash_builder.build_hasher());

Required methods

fn get_hash<H: Hasher>(&self, hasher: H) -> u64

Loading content...

Implementors

impl<T> CallHasher for T where
    T: Hash
[src]

Loading content...