pub trait CallHasher {
    fn get_hash<H: Hash + ?Sized, B: BuildHasher>(
        value: &H,
        build_hasher: &B
    ) -> u64; }
Expand description

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.

Example

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

let hash_builder = RandomState::new();
//...
let value = 17;
let hash = u32::get_hash(&value, &hash_builder);

Required Methods

Implementors