Struct LiveDataRecordingReader

Source
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,

Source

pub fn new(reader: T) -> LiveDataRecordingReader<T>

Construct a new LiveDataRecordingReader<T> instance.

Source

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.

Source

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.

Source

pub fn read_data(&mut self) -> Result<Option<Data>, Error>

Read from the stream until a valid Data variant can be decoded.

Source

pub fn read_to_stats(&mut self) -> Result<LiveDataRecordingStats, Error>

Quickly read to EOF of the source and return the LiveDataRecordingStats.

Source

pub fn offset(&self) -> usize

Get amount of already consumed bytes.

Trait Implementations§

Source§

impl<T> Debug for LiveDataRecordingReader<T>
where T: Debug + Read,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.