Enum resol_vbus::Data [−][src]
Expand description
Data
is a type that contains one of the supported VBus protocol data variants.
Examples
use std::io::Read;
use resol_vbus::{LiveDataReader, Result};
fn print_data_ids<R: Read>(r: R) -> Result<()> {
let mut ldr = LiveDataReader::new(0, r);
while let Some(data) = ldr.read_data()? {
if !data.is_packet() {
continue;
}
println!("{}: {}", data.as_header().timestamp, data.id_string());
}
Ok(())
}
Variants
Packet(Packet)
Contains a Packet
conforming to VBus protocol version 1.x.
Tuple Fields of Packet
0: Packet
Datagram(Datagram)
Contains a Datagram
conforming to VBus protocol version 2.x.
Tuple Fields of Datagram
0: Datagram
Telegram(Telegram)
Contains a Telegram
conforming to VBus protocol version 3.x.
Tuple Fields of Telegram
0: Telegram
Implementations
Returns true
if the variant is a Packet
.
Returns true
if the variant is a Packet
.
Returns the Packet
value, consuming the Data
value.
Panics
The function panics if the Data
value is no Packet
variant.
Returns the Datagram
value, consuming the Data
value.
Panics
The function panics if the Data
value is no Datagram
variant.
Returns the Telegram
value, consuming the Data
value.
Panics
The function panics if the Data
value is no Telegram
variant.
Trait Implementations
Returns true
if two Data
values are “identical”.
Each Data
variant has a set of fields that make up its “identity”. The PartialEq
trait
implementation checks those fields for equality and returns true
if all of the fields
match.
See the descriptions for the Header
, Packet
, Datagram
and Telegram
types to find
out which fields are considered in each case.
Compares two Data
values are “identical”.
Each Data
variant has a set of fields that make up its “identity”. The PartialOrd
trait
implementation compares those fields.
See the descriptions for the Header
, Packet
, Datagram
and Telegram
types to find
out which fields are considered in each case.
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Data
impl UnwindSafe for Data
Blanket Implementations
Mutably borrows from an owned value. Read more