pub struct Chunker { /* private fields */ }Expand description
Content-defined chunker using the FastCDC / gear-hash algorithm.
Ported from xet-core’s Chunker (deduplication/src/chunking.rs).
Implementations§
Source§impl Chunker
impl Chunker
Sourcepub fn new(target_chunk_size: usize) -> Self
pub fn new(target_chunk_size: usize) -> Self
Construct a chunker targeting the given average chunk size. The size must be a power of two greater than the 64-byte gear-hash window.
Sourcepub fn next_boundary(&mut self, data: &[u8]) -> Option<usize>
pub fn next_boundary(&mut self, data: &[u8]) -> Option<usize>
Look for the next chunk boundary in data, carrying over any buffered
bytes from the previous call. Returns the offset into data at which
the chunk ends, or None if no boundary can be decided yet.
Direct port of xet-core’s Chunker::next_boundary.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Chunker
impl RefUnwindSafe for Chunker
impl Send for Chunker
impl Sync for Chunker
impl Unpin for Chunker
impl UnsafeUnpin for Chunker
impl UnwindSafe for Chunker
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