Struct resol_vbus::LiveDataRecordingReader
source · pub struct LiveDataRecordingReader<T: Read> { /* private fields */ }
Expand description
A RecordingReader
for type 0x88 live data recordings.
Examples
use resol_vbus::{FileListReader, LiveDataRecordingReader};
let files: Vec<_> = std::env::args().skip(1).collect();
let flr = FileListReader::new(files);
let mut ldrr = LiveDataRecordingReader::new(flr);
while let Some(data) = ldrr.read_data().unwrap() {
// process the data
println!("{}: {}", data.as_header().timestamp, data.id_string());
}
Implementations§
source§impl<T: Read> LiveDataRecordingReader<T>
impl<T: Read> LiveDataRecordingReader<T>
sourcepub fn new(reader: T) -> LiveDataRecordingReader<T>
pub fn new(reader: T) -> LiveDataRecordingReader<T>
Construct a new LiveDataRecordingReader<T>
instance.
sourcepub fn set_min_max_timestamps(
&mut self,
min_timestamp: Option<DateTime<Utc>>,
max_timestamp: Option<DateTime<Utc>>
)
pub fn set_min_max_timestamps(
&mut self,
min_timestamp: Option<DateTime<Utc>>,
max_timestamp: Option<DateTime<Utc>>
)
Set optional minimum and maximum timestamps for prefiltering data.
sourcepub fn read_topology_data_set(&mut self) -> Result<DataSet>
pub fn read_topology_data_set(&mut self) -> Result<DataSet>
Quickly read to EOF of the source and return the DataSet for all uniquely found Data
variants.
sourcepub fn read_data(&mut self) -> Result<Option<Data>>
pub fn read_data(&mut self) -> Result<Option<Data>>
Read from the stream until a valid Data
variant can be decoded.
sourcepub fn read_to_stats(&mut self) -> Result<LiveDataRecordingStats>
pub fn read_to_stats(&mut self) -> Result<LiveDataRecordingStats>
Quickly read to EOF of the source and return the LiveDataRecordingStats
.