Struct highway::SseHash

source ·
pub struct SseHash { /* private fields */ }
Expand description

SSE empowered implementation that will only work on x86_64 with sse 4.1 enabled at the CPU level.

Implementations§

source§

impl SseHash

source

pub unsafe fn force_new(key: Key) -> Self

Available with target feature sse4.1 only.

Creates a new SseHash while circumventing the runtime check for sse4.1.

Safety

If called on a machine without sse4.1, 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 sse4.1 capabilities

source

pub fn new(key: Key) -> Option<Self>

Create a new SseHash if the sse4.1 feature is detected

Trait Implementations§

source§

impl Clone for SseHash

source§

fn clone(&self) -> SseHash

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
source§

impl Debug for SseHash

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for SseHash

source§

fn default() -> SseHash

Returns the “default value” for a type. Read more
source§

impl Hasher for SseHash

source§

fn write(&mut self, bytes: &[u8])

Writes some data into this Hasher. Read more
source§

fn finish(&self) -> u64

Returns the hash value for the values written so far. Read more
1.3.0 · source§

fn write_u8(&mut self, i: u8)

Writes a single u8 into this hasher.
1.3.0 · source§

fn write_u16(&mut self, i: u16)

Writes a single u16 into this hasher.
1.3.0 · source§

fn write_u32(&mut self, i: u32)

Writes a single u32 into this hasher.
1.3.0 · source§

fn write_u64(&mut self, i: u64)

Writes a single u64 into this hasher.
1.26.0 · source§

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)

Writes a single usize into this hasher.
1.3.0 · source§

fn write_i8(&mut self, i: i8)

Writes a single i8 into this hasher.
1.3.0 · source§

fn write_i16(&mut self, i: i16)

Writes a single i16 into this hasher.
1.3.0 · source§

fn write_i32(&mut self, i: i32)

Writes a single i32 into this hasher.
1.3.0 · source§

fn write_i64(&mut self, i: i64)

Writes a single i64 into this hasher.
1.26.0 · source§

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)

Writes a single isize into this hasher.
source§

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§

fn write_str(&mut self, s: &str)

🔬This is a nightly-only experimental API. (hasher_prefixfree_extras)
Writes a single str into this hasher. Read more
source§

impl HighwayHash for SseHash

source§

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

Consumes the hasher to return the 64bit hash
source§

fn finalize128(self) -> [u64; 2]

Consumes the hasher to return the 128bit hash
source§

fn finalize256(self) -> [u64; 4]

Consumes the hasher to return the 256bit hash
source§

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§

fn hash128(self, data: &[u8]) -> [u64; 2]

Convenience function for hashing all data in a single call and receiving a 128bit hash. Results are equivalent to appending the data manually.
source§

fn hash256(self, data: &[u8]) -> [u64; 4]

Convenience function for hashing all data in a single call and receiving a 256bit hash. Results are equivalent to appending the data manually.
source§

impl Write for SseHash

source§

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<()>

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
1.36.0 · source§

fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>

Like write, except that it writes from a slice of buffers. Read more
source§

fn is_write_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored implementation. Read more
1.0.0 · source§

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>

🔬This is a nightly-only experimental API. (write_all_vectored)
Attempts to write multiple buffers into this writer. Read more
1.0.0 · source§

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

Writes a formatted string into this writer, returning any error encountered. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Selfwhere Self: Sized,

Creates a “by reference” adapter for this instance of Write. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.