pub struct LiveDataRecordingReader<T>where
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> LiveDataRecordingReader<T>where
T: Read,
impl<T> LiveDataRecordingReader<T>where
T: Read,
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, Error>
pub fn read_topology_data_set(&mut self) -> Result<DataSet, Error>
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>, Error>
pub fn read_data(&mut self) -> Result<Option<Data>, Error>
Read from the stream until a valid Data
variant can be decoded.
Sourcepub fn read_to_stats(&mut self) -> Result<LiveDataRecordingStats, Error>
pub fn read_to_stats(&mut self) -> Result<LiveDataRecordingStats, Error>
Quickly read to EOF of the source and return the LiveDataRecordingStats
.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for LiveDataRecordingReader<T>where
T: Freeze,
impl<T> RefUnwindSafe for LiveDataRecordingReader<T>where
T: RefUnwindSafe,
impl<T> Send for LiveDataRecordingReader<T>where
T: Send,
impl<T> Sync for LiveDataRecordingReader<T>where
T: Sync,
impl<T> Unpin for LiveDataRecordingReader<T>where
T: Unpin,
impl<T> UnwindSafe for LiveDataRecordingReader<T>where
T: UnwindSafe,
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