pub struct FileIndex {
pub log_metadata: Vec<LogMetadata>,
pub total_count: usize,
}Expand description
Index structure for efficient file navigation
Fields§
§log_metadata: Vec<LogMetadata>Metadata for each log entry
total_count: usizeTotal number of logs
Implementations§
Source§impl FileIndex
impl FileIndex
Sourcepub fn build_from_lines(lines: &[String]) -> Result<Self, TramexError>
pub fn build_from_lines(lines: &[String]) -> Result<Self, TramexError>
Build an index by scanning the file This is a fast operation that only extracts timestamps and layers
§Errors
Fails on parsing failure
Sourcepub fn find_next_enabled_index(
&self,
current_index: usize,
layer_filter: &impl Fn(&Layer) -> bool,
) -> Option<usize>
pub fn find_next_enabled_index( &self, current_index: usize, layer_filter: &impl Fn(&Layer) -> bool, ) -> Option<usize>
Find the next log index that matches the enabled layers
Sourcepub fn find_previous_enabled_index(
&self,
current_index: usize,
layer_filter: &impl Fn(&Layer) -> bool,
) -> Option<usize>
pub fn find_previous_enabled_index( &self, current_index: usize, layer_filter: &impl Fn(&Layer) -> bool, ) -> Option<usize>
Find the previous log index that matches the enabled layers
Sourcepub fn get_metadata(&self, index: usize) -> Option<&LogMetadata>
pub fn get_metadata(&self, index: usize) -> Option<&LogMetadata>
Get metadata for a specific log index
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FileIndex
impl RefUnwindSafe for FileIndex
impl Send for FileIndex
impl Sync for FileIndex
impl Unpin for FileIndex
impl UnwindSafe for FileIndex
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