pub trait DataReader<T>where
T: Default + Serialization,{
Show 13 methods
// Required methods
fn get_header0(&self) -> u8;
fn get_header1(&self) -> u8;
fn get_filenames(&self) -> &Vec<String>;
fn get_file_idx(&self) -> usize;
fn set_file_idx(&mut self, idx: usize);
fn set_file_reader(&mut self, freader: BufReader<File>);
fn prime_next_file(&mut self) -> Option<usize>;
fn set_cursor(&mut self, pos: usize);
fn read_next(&mut self) -> Option<T>;
// Provided methods
fn get_current_filename(&self) -> Option<&str> { ... }
fn first(&mut self) -> Option<T> { ... }
fn last(&mut self) -> Option<T> { ... }
fn rewind(&mut self) -> Result<()> { ... }
}Expand description
Generics for packet reading (TofPacket, Telemetry packet,…) FIXME - not implemented yet
Required Methods§
fn get_header0(&self) -> u8
fn get_header1(&self) -> u8
Sourcefn get_filenames(&self) -> &Vec<String>
fn get_filenames(&self) -> &Vec<String>
Return all filenames the reader is primed with
Sourcefn get_file_idx(&self) -> usize
fn get_file_idx(&self) -> usize
The current index corresponding to the file the reader is currently working on
Sourcefn set_file_idx(&mut self, idx: usize)
fn set_file_idx(&mut self, idx: usize)
Set a new file idx corresponding to a file the reader is currently working on
Sourcefn set_file_reader(&mut self, freader: BufReader<File>)
fn set_file_reader(&mut self, freader: BufReader<File>)
reset a new reader
Sourcefn prime_next_file(&mut self) -> Option<usize>
fn prime_next_file(&mut self) -> Option<usize>
Get the next file ready
Sourcefn set_cursor(&mut self, pos: usize)
fn set_cursor(&mut self, pos: usize)
Manage the internal cursor attribute
Provided Methods§
Sourcefn get_current_filename(&self) -> Option<&str>
fn get_current_filename(&self) -> Option<&str>
The name of the file the reader is currently working on
Sourcefn first(&mut self) -> Option<T>
fn first(&mut self) -> Option<T>
Get the first entry in all of the files the reader is primed with
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".