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
enumeration, which enumerates over all ISO 639
alpha-2 codes. However, it is also possible to derive one from its alpha-3 t and alpha-3 b
codes, if wished.
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 | An error that may arise while working with the |
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 |