pub struct DiskLogReader { /* private fields */ }Expand description
Provides random-access line reading from disk log files using the sidecar
.idx index. Handles rotated files (.1, .2, …) transparently.
Implementations§
Source§impl DiskLogReader
impl DiskLogReader
pub fn new(log_dir: PathBuf, process: String) -> Self
Sourcepub fn line_count(&mut self, source: LineSource) -> usize
pub fn line_count(&mut self, source: LineSource) -> usize
Total line count for a stream across current + rotated files.
Sourcepub fn line_count_both(&mut self) -> usize
pub fn line_count_both(&mut self) -> usize
Total line count for merged both-streams view.
Sourcepub fn read_lines(
&mut self,
source: LineSource,
start: usize,
count: usize,
) -> Result<Vec<String>>
pub fn read_lines( &mut self, source: LineSource, start: usize, count: usize, ) -> Result<Vec<String>>
Read lines [start..start+count) for a single stream, spanning
rotated files oldest-to-newest.
Sourcepub fn read_interleaved(
&mut self,
start: usize,
count: usize,
) -> Result<Vec<(LineSource, String)>>
pub fn read_interleaved( &mut self, start: usize, count: usize, ) -> Result<Vec<(LineSource, String)>>
Read interleaved lines for “Both” mode, merge-sorted by sequence number.
Auto Trait Implementations§
impl Freeze for DiskLogReader
impl RefUnwindSafe for DiskLogReader
impl Send for DiskLogReader
impl Sync for DiskLogReader
impl Unpin for DiskLogReader
impl UnsafeUnpin for DiskLogReader
impl UnwindSafe for DiskLogReader
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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