[−][src]Struct gearhash::Hasher
Gear hash state. Processes bytes to find chunk boundaries.
Methods
impl<'t> Hasher<'t>
[src]
pub fn new(table: &'t Table) -> Self
[src]
Create a new hasher with the given table.
pub fn update(&mut self, buf: &[u8])
[src]
Update the hash state by processing all the bytes in the given slice.
pub fn is_match(&self, mask: u64) -> bool
[src]
Match the current hash state against the given mask.
Returns true if hash & mask == 0
, false otherwise.
pub fn next_match(&mut self, buf: &[u8], mask: u64) -> Option<usize>
[src]
Processes the given byte slice until a match is found for the given mask.
If a match is found before the end of the byte slice, it returns the number
of bytes processed. If no match has been found, it returns None
.
pub fn get_hash(&self) -> u64
[src]
Retrieve the current hash value.
pub fn set_hash(&mut self, hash: u64)
[src]
Set the hash value to the given integer.
Trait Implementations
impl<'t> Clone for Hasher<'t>
[src]
impl<'t> Debug for Hasher<'t>
[src]
impl Default for Hasher<'static>
[src]
Auto Trait Implementations
impl<'t> RefUnwindSafe for Hasher<'t>
impl<'t> Send for Hasher<'t>
impl<'t> Sync for Hasher<'t>
impl<'t> Unpin for Hasher<'t>
impl<'t> UnwindSafe for Hasher<'t>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,