Expand description
§iso639-1
iso639 v1 enum and utils (for Rust)
§Iso 639-1
ISO 639-1:2002, Codes for the representation of names of languages — Part 1: Alpha-2 code, is the first part of the ISO 639 series of international standards for language codes. Part 1 covers the registration of two-letter codes. There are 184 two-letter codes registered as of October 2015. The registered codes cover the world’s major languages. (source https://en.wikipedia.org/wiki/ISO_639-1)
§Features
Optional features:
- [
serde
][]: Enable serialization/deserialization via serde. - [
strum
][]: Derive EnumIter on Iso639_1.
§Example
extern crate iso639_1;
use iso639_1::{Iso639_1, to_iso639_3};
use std::convert::TryFrom;
pub fn main() {
assert!(Iso639_1::Fr != Iso639_1::En);
assert!(Iso639_1::try_from("fr").unwrap() == Iso639_1::Fr);
assert!(to_iso639_3("fr").unwrap() == "fra");
}
§Links
github: https://github.com/AlbanMinassian/iso639
§license
MIT
Structs§
Enums§
- Iso639_
1 - iso639-1 enum
- Iso639v1
Error Kind
Functions§
- to_
iso639_ 3 - get iso639-3 string (3 chars) switch iso639-1 string (2 chars) - or error
Iso639v1Error