pub struct AvxHash { /* private fields */ }
Expand description
AVX empowered implementation that will only work on x86_64
with avx2 enabled at the CPU
level.
Implementations§
source§impl AvxHash
impl AvxHash
sourcepub unsafe fn force_new(key: Key) -> Self
Available with target feature avx2
only.
pub unsafe fn force_new(key: Key) -> Self
avx2
only.Creates a new AvxHash
while circumventing the runtime check for avx2.
Safety
If called on a machine without avx2, a segfault will occur. Only use if you have control over the deployment environment and have either benchmarked that the runtime check is significant or are unable to check for avx2 capabilities
Trait Implementations§
source§impl Hasher for AvxHash
impl Hasher for AvxHash
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
source§impl HighwayHash for AvxHash
impl HighwayHash for AvxHash
source§fn append(&mut self, data: &[u8])
fn append(&mut self, data: &[u8])
Adds data to be hashed. If it is important, the performance characteristics of this
function differs depending on the amount of data previously hashed and the amount of
data to be hashed. For instance, if one appends 50, 1 byte slices then appending the 32nd
byte will have a performance outlier as the internal 32 byte block is complete and internally processed.
source§fn finalize64(self) -> u64
fn finalize64(self) -> u64
Consumes the hasher to return the 64bit hash
source§fn finalize128(self) -> [u64; 2]
fn finalize128(self) -> [u64; 2]
Consumes the hasher to return the 128bit hash
source§fn finalize256(self) -> [u64; 4]
fn finalize256(self) -> [u64; 4]
Consumes the hasher to return the 256bit hash
source§fn hash64(self, data: &[u8]) -> u64
fn hash64(self, data: &[u8]) -> u64
Convenience function for hashing all data in a single call and receiving a 64bit hash.
Results are equivalent to appending the data manually.
source§impl Write for AvxHash
impl Write for AvxHash
source§fn write(&mut self, bytes: &[u8]) -> Result<usize>
fn write(&mut self, bytes: &[u8]) -> Result<usize>
Write a buffer into this writer, returning how many bytes were written. Read more
source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
)1.0.0 · source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for AvxHash
impl Send for AvxHash
impl Sync for AvxHash
impl Unpin for AvxHash
impl UnwindSafe for AvxHash
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