pub struct PolymurHasher { /* private fields */ }Expand description
A hasher that implements the core library’s Hasher trait.
This allows PolymurHash to be used with HashMap and HashSet, even in no_std environments
(requires alloc for the internal buffer).
§Examples
Using with HashMap:
use std::collections::HashMap;
use std::hash::BuildHasherDefault;
use polymur_hash::PolymurHasher;
type PolymurHashMap<K, V> = HashMap<K, V, BuildHasherDefault<PolymurHasher>>;
let mut map: PolymurHashMap<String, i32> = PolymurHashMap::default();
map.insert("hello".to_string(), 42);Implementations§
Trait Implementations§
Source§impl Clone for PolymurHasher
impl Clone for PolymurHasher
Source§fn clone(&self) -> PolymurHasher
fn clone(&self) -> PolymurHasher
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PolymurHasher
impl Debug for PolymurHasher
Source§impl Default for PolymurHasher
impl Default for PolymurHasher
Source§impl Hasher for PolymurHasher
impl Hasher for PolymurHasher
Source§fn write_u128(&mut self, i: u128)
fn write_u128(&mut self, i: u128)
Writes a single
u128 into this hasher.Source§fn write_usize(&mut self, i: usize)
fn write_usize(&mut self, i: usize)
Writes a single
usize into this hasher.Source§fn write_i128(&mut self, i: i128)
fn write_i128(&mut self, i: i128)
Writes a single
i128 into this hasher.Source§fn write_isize(&mut self, i: isize)
fn write_isize(&mut self, i: isize)
Writes a single
isize into this hasher.Source§fn write_length_prefix(&mut self, len: usize)
fn write_length_prefix(&mut self, len: usize)
🔬This is a nightly-only experimental API. (
hasher_prefixfree_extras)Writes a length prefix into this hasher, as part of being prefix-free. Read more
Auto Trait Implementations§
impl Freeze for PolymurHasher
impl RefUnwindSafe for PolymurHasher
impl Send for PolymurHasher
impl Sync for PolymurHasher
impl Unpin for PolymurHasher
impl UnwindSafe for PolymurHasher
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