Skip to main content

DataReader

Trait DataReader 

Source
pub trait DataReader<T>{
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§

Source

fn get_header0(&self) -> u8

Source

fn get_header1(&self) -> u8

Source

fn get_filenames(&self) -> &Vec<String>

Return all filenames the reader is primed with

Source

fn get_file_idx(&self) -> usize

The current index corresponding to the file the reader is currently working on

Source

fn set_file_idx(&mut self, idx: usize)

Set a new file idx corresponding to a file the reader is currently working on

Source

fn set_file_reader(&mut self, freader: BufReader<File>)

reset a new reader

Source

fn prime_next_file(&mut self) -> Option<usize>

Get the next file ready

Source

fn set_cursor(&mut self, pos: usize)

Manage the internal cursor attribute

Source

fn read_next(&mut self) -> Option<T>

Get the next frame/packet from the stream. Can be used to implement iterators

Provided Methods§

Source

fn get_current_filename(&self) -> Option<&str>

The name of the file the reader is currently working on

Source

fn first(&mut self) -> Option<T>

Get the first entry in all of the files the reader is primed with

Source

fn last(&mut self) -> Option<T>

Get the last entry in all of the files the reader is primed with

Source

fn rewind(&mut self) -> Result<()>

Rewind the current file and set the file index to the first file, so data can be read again from the beginning

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§