pub struct HashHasherBuilder { /* private fields */ }Available on crate feature
rand and neither target_os=solana nor BPF only.Expand description
A builder for faster, but less collision resistant hasher for hashes.
Initializes HashHasher instances that use an 8-byte
slice of the hash as the hash value. Should not be used when
collisions might be used to mount DOS attacks.
Using this results in about 4x faster lookups in a typical hashmap.
Implementations§
Trait Implementations§
Source§impl BuildHasher for HashHasherBuilder
impl BuildHasher for HashHasherBuilder
Source§impl Clone for HashHasherBuilder
impl Clone for HashHasherBuilder
Source§fn clone(&self) -> HashHasherBuilder
fn clone(&self) -> HashHasherBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for HashHasherBuilder
impl Default for HashHasherBuilder
Source§fn default() -> Self
fn default() -> Self
Default construct the HashHasherBuilder.
The position of the slice is determined initially
through random draw and then by incrementing a thread-local
This way each hashmap can be expected to use a slightly different
slice. This is essentially the same mechanism as what is used by
RandomState
Auto Trait Implementations§
impl Freeze for HashHasherBuilder
impl RefUnwindSafe for HashHasherBuilder
impl Send for HashHasherBuilder
impl Sync for HashHasherBuilder
impl Unpin for HashHasherBuilder
impl UnsafeUnpin for HashHasherBuilder
impl UnwindSafe for HashHasherBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more