pub struct FxHash { /* private fields */ }Expand description
Implementation of the FxHash algorithm.
This is a fast, non-cryptographic hash function, suitable for use in hash tables.
Implementations§
Source§impl FxHash
impl FxHash
Sourcepub const fn update_const(&mut self, data: &[u8])
pub const fn update_const(&mut self, data: &[u8])
Updates the internal state with the given data.
Sourcepub const fn result_const(&self) -> u64
pub const fn result_const(&self) -> u64
Returns the final hash value.
This function does not update the internal state, and thus
FxHash can still be used afterwards.
Sourcepub const fn clone_const(&self) -> Self
pub const fn clone_const(&self) -> Self
Clones the FxHash instance.
Trait Implementations§
Source§impl HashFunction for FxHash
impl HashFunction for FxHash
type Output = [u8; 8]
Source§fn update(&mut self, data: impl AsRef<[u8]>)
fn update(&mut self, data: impl AsRef<[u8]>)
Updates the internal state of the
HashFunction with given data.Source§fn write_result(&self, output: &mut Self::Output)
fn write_result(&self, output: &mut Self::Output)
Writes the final result to the output passed as ref parameter.
Source§fn result(&self) -> Self::Output
fn result(&self) -> Self::Output
A wrapper around
HashFunction::write_result that returns the hash
instead of writing it to output parameter.Source§impl Hasher for FxHash
impl Hasher for FxHash
1.26.0 · Source§fn write_u128(&mut self, i: u128)
fn write_u128(&mut self, i: u128)
Writes a single
u128 into this hasher.1.3.0 · Source§fn write_usize(&mut self, i: usize)
fn write_usize(&mut self, i: usize)
Writes a single
usize into this hasher.1.26.0 · Source§fn write_i128(&mut self, i: i128)
fn write_i128(&mut self, i: i128)
Writes a single
i128 into this hasher.1.3.0 · 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 FxHash
impl RefUnwindSafe for FxHash
impl Send for FxHash
impl Sync for FxHash
impl Unpin for FxHash
impl UnsafeUnpin for FxHash
impl UnwindSafe for FxHash
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