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§

§

En

English language

§

De

German language

§

Fr

French language

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.