Module iso::language [−][src]
Expand description
Type definitions related to thie ISO 639 language code standard
Most of this module is dedicated to the code enumerations, which each enumerate over their corresponding iso language code sets. Each can be converted into each other, provided that they have a corresponding language code in the other set.
Basic usage
// the variant representing the english language let english = Iso639_1::En; println!("The name of the language represented by the ISO 639-3 code of {:?} is {}!", TryInto::<Iso639_3>::try_into(english), english.name()); assert_eq!(english.name(), "English"); assert_eq!(english.code(), "en"); assert_eq!(english.try_into(), Ok(Iso639_1::En)); assert_eq!(english.try_into(), Ok(Iso639_2b::Eng)); assert_eq!(english.try_into(), Ok(Iso639_2t::Eng)); assert_eq!(english.try_into(), Ok(Iso639_3::Eng));
Macros
language_impl | |
language_impl_try_from |
Enums
Error | A list of all possible errors encountered while working with the language code enumerations |
Iso639_1 | Enumeration over all possible ISO 639-1 language codes |
Iso639_2b | Enumeration over all possible ISO 639-2b language codes |
Iso639_2t | Enumeration over all possible ISO 639-2t language codes |
Iso639_3 | Enumeration over all possible ISO 639-3 language codes |
Traits
Language | An abstraction over a language code providing ways to extract information as well as convert |