pub struct ChargedByteReader { /* private fields */ }Expand description
Fixed-size chunk iterator over a file.
Implementations§
Source§impl ChargedByteReader
impl ChargedByteReader
pub fn new( file: File, chunk_size: usize, limits: &TenantLimits, held: Option<OpenFileGuard>, ) -> Result<Self, MemoryCapExceeded>
Sourcepub fn read_next(&mut self) -> Result<Option<Vec<u8>>>
pub fn read_next(&mut self) -> Result<Option<Vec<u8>>>
Next chunk of up to chunk_size bytes; the final chunk may be short.
Ok(None) at EOF or once closed.
pub fn close(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChargedByteReader
impl RefUnwindSafe for ChargedByteReader
impl Send for ChargedByteReader
impl Sync for ChargedByteReader
impl Unpin for ChargedByteReader
impl UnsafeUnpin for ChargedByteReader
impl UnwindSafe for ChargedByteReader
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