pub struct PacketFieldSpec {
    pub field_id: String,
    pub packet_field_id: String,
    pub name: String,
    pub unit_id: UnitId,
    pub unit_family: UnitFamily,
    pub unit_code: String,
    pub unit_text: String,
    pub precision: i32,
    pub typ: Type,
    pub parts: Vec<PacketTemplateFieldPart>,
    pub language: Language,
}
Expand description

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.

Implementations§

Construct an i64 raw value from a slice of bytes.

Construct a f64 raw value from a slice of bytes.

Format a raw value into its textual representation.

Trait Implementations§

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.