pub struct ChunkedReader { /* private fields */ }Expand description
A reader that processes data in chunks.
Implementations§
Source§impl ChunkedReader
impl ChunkedReader
Sourcepub async fn from_file<P: AsRef<Path>>(
path: P,
strategy: ChunkStrategy,
buffer_size: usize,
prefetch_count: usize,
) -> Result<Self>
pub async fn from_file<P: AsRef<Path>>( path: P, strategy: ChunkStrategy, buffer_size: usize, prefetch_count: usize, ) -> Result<Self>
Create a new chunked reader from a file.
Sourcepub async fn read_chunk(&mut self) -> Result<Option<Bytes>>
pub async fn read_chunk(&mut self) -> Result<Option<Bytes>>
Read the next chunk.
Sourcepub fn total_chunks(&self) -> usize
pub fn total_chunks(&self) -> usize
Get the total number of chunks.
Sourcepub fn current_index(&self) -> usize
pub fn current_index(&self) -> usize
Get the current chunk index.
Auto Trait Implementations§
impl !RefUnwindSafe for ChunkedReader
impl !UnwindSafe for ChunkedReader
impl Freeze for ChunkedReader
impl Send for ChunkedReader
impl Sync for ChunkedReader
impl Unpin for ChunkedReader
impl UnsafeUnpin for ChunkedReader
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