pub struct ReadChunker<R, C> { /* private fields */ }Expand description
A chunker for a reader implementing Read.
Note that unlike SliceChunker this stores bytes in an internal buffer
which is re-used and thus it can not implement Iterator.
Implementations§
Source§impl<R, C: Cdc> ReadChunker<R, C>
impl<R, C: Cdc> ReadChunker<R, C>
Sourcepub fn new(reader: R, min_size: usize, max_size: usize, cdc: C) -> Self
pub fn new(reader: R, min_size: usize, max_size: usize, cdc: C) -> Self
Creates a new ReadChunker with the given minimum and maximum chunk
size and CDC instance.
The maximum size is always respected, however the final chunk may not respect the minimum size.
§Panics
Panics if min_size > max_size or max_size == 0.
Trait Implementations§
Source§impl<R: Clone, C: Clone> Clone for ReadChunker<R, C>
impl<R: Clone, C: Clone> Clone for ReadChunker<R, C>
Source§fn clone(&self) -> ReadChunker<R, C>
fn clone(&self) -> ReadChunker<R, C>
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 moreAuto Trait Implementations§
impl<R, C> Freeze for ReadChunker<R, C>
impl<R, C> RefUnwindSafe for ReadChunker<R, C>where
C: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, C> Send for ReadChunker<R, C>
impl<R, C> Sync for ReadChunker<R, C>
impl<R, C> Unpin for ReadChunker<R, C>
impl<R, C> UnwindSafe for ReadChunker<R, C>where
C: UnwindSafe,
R: UnwindSafe,
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