pub struct FileDecompressor {
pub lines_consumed: usize,
/* private fields */
}Expand description
State for incremental zstd decompression and line extraction from a single file.
Fields§
§lines_consumed: usizeGlobal line index up to which lines have been consumed or skipped. This is the value that should be used for checkpointing. Equals skip_before + number of lines actually returned to caller.
Implementations§
Source§impl FileDecompressor
impl FileDecompressor
Sourcepub fn open(path: &Path) -> Result<Self>
pub fn open(path: &Path) -> Result<Self>
Open a file and prepare for incremental zstd decompression.
Sourcepub fn next_line(
&mut self,
skip_before: usize,
) -> Result<Option<DecompressedLine>>
pub fn next_line( &mut self, skip_before: usize, ) -> Result<Option<DecompressedLine>>
Get the next line from this file.
skip_before: lines with index < skip_before are discarded.
Returns:
Ok(Some(line))— a complete line was extracted.Ok(None)— no more data available right now. The caller should check if the file is done or retry later.
Sourcepub fn reset_eof(&mut self)
pub fn reset_eof(&mut self)
Reset the EOF flag so we can try reading more data (useful when tailing a file that is still being written to).
Sourcepub fn has_partial_data(&self) -> bool
pub fn has_partial_data(&self) -> bool
Returns true if there is partial (incomplete line) data remaining in the output buffer.
Auto Trait Implementations§
impl Freeze for FileDecompressor
impl RefUnwindSafe for FileDecompressor
impl Send for FileDecompressor
impl Sync for FileDecompressor
impl Unpin for FileDecompressor
impl UnwindSafe for FileDecompressor
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more