pub type Dialect = UsbId<DIALECT_TAG, u8>;
Expand description
Represents a language dialect in the USB database.
use usb_ids::{Dialect, Language, FromId};
let lang = Language::from_id(0x0007).unwrap();
println!("language: {}", lang.name());
for dialect in lang.dialects() {
println!("\tdialect: {}", dialect.name());
}
Aliased Type§
struct Dialect { /* private fields */ }
Implementations§
source§impl Dialect
impl Dialect
sourcepub fn from_lid_did(language_id: u16, id: u8) -> Option<&'static Self>
pub fn from_lid_did(language_id: u16, id: u8) -> Option<&'static Self>
Returns the Dialect
corresponding to the given language and dialect IDs,
or None
if no such dialect exists in the DB.
use usb_ids::Dialect;
let dialect = Dialect::from_lid_did(0x0007, 0x02).unwrap();
assert_eq!(dialect.name(), "Swiss");