pub struct MinCdcHash4 { /* private fields */ }Expand description
An instance of MinCDCHash4.
This chooses the first splitpoint i where
hash(u32::from_le_bytes(bytes[i-4..i])) is minimized, where
hash(v) = v.wrapping_mul(multiplier).wrapping_add(addend).
Implementations§
Source§impl MinCdcHash4
impl MinCdcHash4
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Create a new instance of MinCDCHash4 with the default hash parameters.
Sourcepub const fn with_params(multiplier: u32, addend: u32) -> Self
pub const fn with_params(multiplier: u32, addend: u32) -> Self
Create a new instance of MinCDCHash4, specifying the hash parameters.
§Panics
Panics if the multiplier isn’t odd. An even multiplier is always strictly worse.
Trait Implementations§
Source§impl Cdc for MinCdcHash4
impl Cdc for MinCdcHash4
Source§fn window_size(&self) -> usize
fn window_size(&self) -> usize
Source§fn best_splitpoint(&self, bytes: &[u8]) -> usize
fn best_splitpoint(&self, bytes: &[u8]) -> usize
Returns the best splitpoint
i <= bytes.len(), indicating bytes is to
be split into bytes[..i] and bytes[i..].Source§impl Clone for MinCdcHash4
impl Clone for MinCdcHash4
Source§fn clone(&self) -> MinCdcHash4
fn clone(&self) -> MinCdcHash4
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MinCdcHash4
impl Debug for MinCdcHash4
Source§impl Default for MinCdcHash4
impl Default for MinCdcHash4
impl Copy for MinCdcHash4
Auto Trait Implementations§
impl Freeze for MinCdcHash4
impl RefUnwindSafe for MinCdcHash4
impl Send for MinCdcHash4
impl Sync for MinCdcHash4
impl Unpin for MinCdcHash4
impl UnwindSafe for MinCdcHash4
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