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.
Sourcepub fn scan_matching_lines(
&mut self,
filter: &str,
mode: StreamMode,
) -> Vec<usize>
pub fn scan_matching_lines( &mut self, filter: &str, mode: StreamMode, ) -> Vec<usize>
Scan all lines in the given stream mode and return indices of lines matching the filter substring. The returned indices are positions within the mode’s address space (single-stream or interleaved).
Sourcepub fn scan_matching_lines_from(
&mut self,
filter: &str,
mode: StreamMode,
start_from: usize,
) -> Vec<usize>
pub fn scan_matching_lines_from( &mut self, filter: &str, mode: StreamMode, start_from: usize, ) -> Vec<usize>
Scan lines starting from start_from in the given stream mode.
Returns indices of matching lines and can be used for incremental updates.
Sourcepub fn read_scattered_lines(
&mut self,
mode: StreamMode,
line_numbers: &[usize],
) -> Vec<(LineSource, String)>
pub fn read_scattered_lines( &mut self, mode: StreamMode, line_numbers: &[usize], ) -> Vec<(LineSource, String)>
Read specific non-contiguous lines by index within the given mode’s address space. Used by filtered scrollback to render only matching lines.
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
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>
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>
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