pub enum Language {
En,
De,
Fr,
}
Expand description
Languages supported by VSF1 specification.
§Examples
use resol_vbus::{Specification, SpecificationFile, Language};
let get_loc_text = |language| {
// Create a new `Specification` for the provided language
let spec = Specification::from_file(SpecificationFile::new_default(), language);
// Get the `PacketSpec` for the standard info packet of the "DeltaSol MX"
let packet_spec = spec.get_packet_spec(0x11, 0x0010, 0x7E11, 0x0100);
// Get the first `PacketFieldSpec`'s name.
packet_spec.get_field_spec("000_2_0").map(|field_spec| field_spec.name.clone()).unwrap()
};
assert_eq!("Temperature sensor 1", get_loc_text(Language::En));
assert_eq!("Temperatur Sensor 1", get_loc_text(Language::De));
assert_eq!("Température sonde 1", get_loc_text(Language::Fr));
Variants§
Trait Implementations§
impl Copy for Language
impl StructuralPartialEq for Language
Auto Trait Implementations§
impl Freeze for Language
impl RefUnwindSafe for Language
impl Send for Language
impl Sync for Language
impl Unpin for Language
impl UnwindSafe for Language
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more