nohash_hasher

Type Alias BuildNoHashHasher

Source
pub type BuildNoHashHasher<T> = BuildHasherDefault<NoHashHasher<T>>;
Expand description

An alias for BuildHasherDefault for use with NoHashHasher.

§Examples

See also IntMap and IntSet for some easier usage examples.

use nohash_hasher::BuildNoHashHasher;
use std::collections::HashMap;

let mut m: HashMap::<u8, char, BuildNoHashHasher<u8>> =
    HashMap::with_capacity_and_hasher(2, BuildNoHashHasher::default());

m.insert(0, 'a');
m.insert(1, 'b');

assert_eq!(Some(&'a'), m.get(&0));
assert_eq!(Some(&'b'), m.get(&1));

Aliased Type§

struct BuildNoHashHasher<T>(/* private fields */);

Implementations

Source§

impl<H> BuildHasherDefault<H>

1.85.0 (const: 1.85.0) · Source

pub const fn new() -> BuildHasherDefault<H>

Creates a new BuildHasherDefault for Hasher H.

Trait Implementations

1.7.0 · Source§

impl<H> BuildHasher for BuildHasherDefault<H>
where H: Default + Hasher,

Source§

type Hasher = H

Type of the hasher that will be created.
Source§

fn build_hasher(&self) -> H

Creates a new hasher. Read more
1.71.0 · Source§

fn hash_one<T>(&self, x: T) -> u64
where T: Hash, Self: Sized, Self::Hasher: Hasher,

Calculates the hash of a single value. Read more
1.7.0 · Source§

impl<H> Clone for BuildHasherDefault<H>

Source§

fn clone(&self) -> BuildHasherDefault<H>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
1.9.0 · Source§

impl<H> Debug for BuildHasherDefault<H>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
1.7.0 · Source§

impl<H> Default for BuildHasherDefault<H>

Source§

fn default() -> BuildHasherDefault<H>

Returns the “default value” for a type. Read more
1.29.0 · Source§

impl<H> PartialEq for BuildHasherDefault<H>

Source§

fn eq(&self, _other: &BuildHasherDefault<H>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
1.29.0 · Source§

impl<H> Eq for BuildHasherDefault<H>