[−][src]Struct async_resol_vbus::specification::PacketSpec
Contains information about a VBus packet and its fields.
Examples
use resol_vbus::{SpecificationFile, Specification, Language}; let spec = Specification::from_file(SpecificationFile::new_default(), Language::De); let packet_spec = spec.get_packet_spec(0x00, 0x0010, 0x7E11, 0x0100); assert_eq!("00_0010_7E11_10_0100", packet_spec.packet_id); assert_eq!(0, packet_spec.channel); assert_eq!(0x0010, packet_spec.destination_address); assert_eq!(0x7E11, packet_spec.source_address); assert_eq!(0x0100, packet_spec.command); assert_eq!("DFA", packet_spec.destination_device.name); assert_eq!("DeltaSol MX [Regler]", packet_spec.source_device.name); assert_eq!("DeltaSol MX [Regler]", packet_spec.name);
Fields
packet_id: String
A packet identifier.
channel: u8
The VBus channel to packet was sent to.
destination_address: u16
The destination VBus address the packet was sent to.
source_address: u16
The source VBus address to packet was send from.
command: u16
The VBus command of the packet.
destination_device: Rc<DeviceSpec>
The DeviceSpec
containing information about the destination VBus device.
source_device: Rc<DeviceSpec>
The DeviceSpec
containing information about the source VBus device.
name: String
The name of the packet, containing channel, source and optionally destination names.
fields: Vec<PacketFieldSpec>
The fields contained in the frame payload of the VBus packet.
Methods
impl PacketSpec
[src]
pub fn get_field_spec_position(&self, id: &str) -> Option<usize>
[src]
Get the position of a PacketFieldSpec
by its field ID.
pub fn get_field_spec_by_position(&self, pos: usize) -> &PacketFieldSpec
[src]
Get a PacketFieldSpec
by its position.
pub fn get_field_spec(&self, id: &str) -> Option<&PacketFieldSpec>
[src]
Get a PacketFieldSpec
by its field ID.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for PacketSpec
impl !Send for PacketSpec
impl !Sync for PacketSpec
impl Unpin for PacketSpec
impl UnwindSafe for PacketSpec
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>,