[][src]Struct async_resol_vbus::SpecificationFile

pub struct SpecificationFile {
    pub datecode: i32,
    pub texts: Vec<String>,
    pub localized_texts: Vec<LocalizedText>,
    pub units: Vec<Unit>,
    pub device_templates: Vec<DeviceTemplate>,
    pub packet_templates: Vec<PacketTemplate>,
}

Contains the information from a VSF1 file.

Fields

datecode: i32

Date of VSF creation in format 'YYYMMDD'

texts: Vec<String>

List of texts.

localized_texts: Vec<LocalizedText>

List of localized texts.

units: Vec<Unit>

List of units.

device_templates: Vec<DeviceTemplate>

List of device templates.

packet_templates: Vec<PacketTemplate>

List of packet templates.

Methods

impl SpecificationFile[src]

pub fn from_bytes(bytes: &[u8]) -> Result<SpecificationFile, Error>[src]

Construct a new SpecificationFile from a byte slice of VSF1 data.

pub fn new_default() -> SpecificationFile[src]

Construct a new SpecificationFile from the embedded default VSF data.

pub fn text_by_index(&self, idx: &TextIndex) -> &str[src]

Get text by its index.

pub fn localized_text_by_index(
    &self,
    idx: &LocalizedTextIndex,
    language: Language
) -> &str
[src]

Get localized text by its index and language.

pub fn unit_family_by_id(&self, id: &UnitFamilyId) -> UnitFamily[src]

Get UnitFamily by its ID.

pub fn unit_by_id(&self, id: &UnitId) -> &Unit[src]

Get Unit by its index.

pub fn type_by_id(&self, id: &TypeId) -> Type[src]

Get Type by its ID.

pub fn find_device_template(
    &self,
    self_address: u16,
    peer_address: u16
) -> Option<&DeviceTemplate>
[src]

Find a DeviceTemplate matching the self and peer addresses.

pub fn find_packet_template(
    &self,
    destination_address: u16,
    source_address: u16,
    command: u16
) -> Option<&PacketTemplate>
[src]

Find a PacketTemplate matching the destination and source addresses as well as the command.

Trait Implementations

impl Debug for SpecificationFile[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.