[−][src]Struct async_resol_vbus::specification::PacketFieldSpec
Contains information about a VBus packet field.
Examples
use resol_vbus::{SpecificationFile, Specification, Language}; use resol_vbus::specification_file::{UnitFamily, Type}; let spec = Specification::from_file(SpecificationFile::new_default(), Language::De); let packet_spec = spec.get_packet_spec(0x00, 0x0010, 0x7E11, 0x0100); let packet_field_spec = &packet_spec.fields [0]; assert_eq!("000_2_0", packet_field_spec.field_id); assert_eq!("00_0010_7E11_10_0100_000_2_0", packet_field_spec.packet_field_id); assert_eq!("Temperatur Sensor 1", packet_field_spec.name); assert_eq!(62, packet_field_spec.unit_id.0); assert_eq!(UnitFamily::Temperature, packet_field_spec.unit_family); assert_eq!("DegreesCelsius", packet_field_spec.unit_code); assert_eq!(" °C", packet_field_spec.unit_text); assert_eq!(1, packet_field_spec.precision); assert_eq!(Type::Number, packet_field_spec.typ);
Fields
field_id: String
A field identifier.
packet_field_id: String
A packet-field identifier.
name: String
The name of the field.
unit_id: UnitId
The UnitId
of the field.
unit_family: UnitFamily
The UnitFamily
of the field.
unit_code: String
The unit code of the field.
unit_text: String
The unit text of the field.
precision: i32
The precision of the field.
typ: Type
The Type
of the field.
parts: Vec<PacketTemplateFieldPart>
The parts the field consists of.
language: Language
The language used for the specification.
Methods
impl PacketFieldSpec
[src]
pub fn raw_value_i64(&self, buf: &[u8]) -> Option<i64>
[src]
Construct an i64
raw value from a slice of bytes.
pub fn raw_value_f64(&self, buf: &[u8]) -> Option<f64>
[src]
Construct a f64
raw value from a slice of bytes.
pub fn fmt_raw_value(
&self,
raw_value: Option<i64>,
append_unit: bool
) -> PacketFieldFormatter
[src]
&self,
raw_value: Option<i64>,
append_unit: bool
) -> PacketFieldFormatter
Format a raw value into its textual representation.
Trait Implementations
impl Debug for PacketFieldSpec
[src]
impl PartialEq<PacketFieldSpec> for PacketFieldSpec
[src]
fn eq(&self, other: &PacketFieldSpec) -> bool
[src]
fn ne(&self, other: &PacketFieldSpec) -> bool
[src]
impl StructuralPartialEq for PacketFieldSpec
[src]
Auto Trait Implementations
impl RefUnwindSafe for PacketFieldSpec
impl Send for PacketFieldSpec
impl Sync for PacketFieldSpec
impl Unpin for PacketFieldSpec
impl UnwindSafe for PacketFieldSpec
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>,