[−][src]Struct async_resol_vbus::RecordingReader
Allows reading Data
variants from a Read
trait object.
Examples
use resol_vbus::{FileListReader, RecordingReader}; let files: Vec<_> = std::env::args().skip(1).collect(); let flr = FileListReader::new(files); let mut rr = RecordingReader::new(flr); while let Some(data_set) = rr.read_data_set().unwrap() { // process the data set println!("{}:", data_set.timestamp); for data in data_set.iter() { println!(" - {}", data.id_string()); } }
Methods
impl<R> RecordingReader<R> where
R: Read,
[src]
R: Read,
pub fn new(reader: R) -> RecordingReader<R>
[src]
Constructs a RecordingReader
.
pub fn set_min_max_timestamps(
&mut self,
min_timestamp: Option<DateTime<Utc>>,
max_timestamp: Option<DateTime<Utc>>
)
[src]
&mut self,
min_timestamp: Option<DateTime<Utc>>,
max_timestamp: Option<DateTime<Utc>>
)
Set optional minimum and maximum timestamps for prefiltering data.
pub fn read_record(&mut self) -> Result<&[u8], Error>
[src]
Read from the stream until a valid blob of data is found.
pub fn read_data_set(&mut self) -> Result<Option<DataSet>, Error>
[src]
Read from the stream until a valid DataSet
variant can be decoded.
pub fn read_topology_data_set(&mut self) -> Result<DataSet, Error>
[src]
Quickly read to EOF of the source and return the DataSet for all uniquely found Data
variants.
pub fn offset(&self) -> usize
[src]
Get amount of already consumed bytes.
Trait Implementations
impl<R> Debug for RecordingReader<R> where
R: Read + Debug,
[src]
R: Read + Debug,
Auto Trait Implementations
impl<R> RefUnwindSafe for RecordingReader<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> Send for RecordingReader<R> where
R: Send,
R: Send,
impl<R> Sync for RecordingReader<R> where
R: Sync,
R: Sync,
impl<R> Unpin for RecordingReader<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for RecordingReader<R> where
R: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,