pub trait FileProcessor {
// Required methods
fn process_lines<F>(&mut self, line_processor: F) -> Result<(), TaleError>
where F: FnMut(&str) -> Result<(), TaleError>;
fn skip_lines(&mut self, count: u64) -> Result<(), TaleError>;
fn file_size(&self) -> u64;
fn seek(&mut self, pos: SeekFrom) -> Result<u64, TaleError>;
fn position(&self) -> u64;
}Expand description
Trait for abstracting different file reading strategies
Required Methods§
Sourcefn process_lines<F>(&mut self, line_processor: F) -> Result<(), TaleError>
fn process_lines<F>(&mut self, line_processor: F) -> Result<(), TaleError>
Process the entire file, calling the provided closure for each line
Sourcefn skip_lines(&mut self, count: u64) -> Result<(), TaleError>
fn skip_lines(&mut self, count: u64) -> Result<(), TaleError>
Skip a specified number of lines from the current position
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".