[][src]Struct gearhash::Hasher

pub struct Hasher<'t> { /* fields omitted */ }

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.