Struct resol_vbus::specification_file::SpecificationFile
source · 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>,
}
Expand description
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.
Implementations§
source§impl SpecificationFile
impl SpecificationFile
sourcepub fn from_bytes(bytes: &[u8]) -> Result<SpecificationFile>
pub fn from_bytes(bytes: &[u8]) -> Result<SpecificationFile>
Construct a new SpecificationFile
from a byte slice of VSF1 data.
sourcepub fn new_default() -> SpecificationFile
pub fn new_default() -> SpecificationFile
Construct a new SpecificationFile
from the embedded default VSF data.
sourcepub fn text_by_index(&self, idx: &TextIndex) -> &str
pub fn text_by_index(&self, idx: &TextIndex) -> &str
Get text by its index.
sourcepub fn localized_text_by_index(
&self,
idx: &LocalizedTextIndex,
language: Language
) -> &str
pub fn localized_text_by_index(
&self,
idx: &LocalizedTextIndex,
language: Language
) -> &str
Get localized text by its index and language.
sourcepub fn unit_family_by_id(&self, id: &UnitFamilyId) -> UnitFamily
pub fn unit_family_by_id(&self, id: &UnitFamilyId) -> UnitFamily
Get UnitFamily
by its ID.
sourcepub fn unit_by_id(&self, id: &UnitId) -> &Unit
pub fn unit_by_id(&self, id: &UnitId) -> &Unit
Get Unit
by its index.
sourcepub fn type_by_id(&self, id: &TypeId) -> Type
pub fn type_by_id(&self, id: &TypeId) -> Type
Get Type
by its ID.
sourcepub fn find_device_template(
&self,
self_address: u16,
peer_address: u16
) -> Option<&DeviceTemplate>
pub fn find_device_template(
&self,
self_address: u16,
peer_address: u16
) -> Option<&DeviceTemplate>
Find a DeviceTemplate
matching the self and peer addresses.
sourcepub fn find_packet_template(
&self,
destination_address: u16,
source_address: u16,
command: u16
) -> Option<&PacketTemplate>
pub fn find_packet_template(
&self,
destination_address: u16,
source_address: u16,
command: u16
) -> Option<&PacketTemplate>
Find a PacketTemplate
matching the destination and source addresses as well as the command.