Enum whatlang::Lang

source ·
pub enum Lang {
Show 69 variants Epo = 0, Eng = 1, Rus = 2, Cmn = 3, Spa = 4, Por = 5, Ita = 6, Ben = 7, Fra = 8, Deu = 9, Ukr = 10, Kat = 11, Ara = 12, Hin = 13, Jpn = 14, Heb = 15, Yid = 16, Pol = 17, Amh = 18, Jav = 19, Kor = 20, Nob = 21, Dan = 22, Swe = 23, Fin = 24, Tur = 25, Nld = 26, Hun = 27, Ces = 28, Ell = 29, Bul = 30, Bel = 31, Mar = 32, Kan = 33, Ron = 34, Slv = 35, Hrv = 36, Srp = 37, Mkd = 38, Lit = 39, Lav = 40, Est = 41, Tam = 42, Vie = 43, Urd = 44, Tha = 45, Guj = 46, Uzb = 47, Pan = 48, Aze = 49, Ind = 50, Tel = 51, Pes = 52, Mal = 53, Ori = 54, Mya = 55, Nep = 56, Sin = 57, Khm = 58, Tuk = 59, Aka = 60, Zul = 61, Sna = 62, Afr = 63, Lat = 64, Slk = 65, Cat = 66, Tgl = 67, Hye = 68,
}
Expand description

Represents a language following ISO 639-3 standard.

Variants§

§

Epo = 0

Esperanto (Esperanto)

§

Eng = 1

English (English)

§

Rus = 2

Русский (Russian)

§

Cmn = 3

普通话 (Mandarin)

§

Spa = 4

Español (Spanish)

§

Por = 5

Português (Portuguese)

§

Ita = 6

Italiano (Italian)

§

Ben = 7

বাংলা (Bengali)

§

Fra = 8

Français (French)

§

Deu = 9

Deutsch (German)

§

Ukr = 10

Українська (Ukrainian)

§

Kat = 11

ქართული (Georgian)

§

Ara = 12

العربية (Arabic)

§

Hin = 13

हिन्दी (Hindi)

§

Jpn = 14

日本語 (Japanese)

§

Heb = 15

עברית (Hebrew)

§

Yid = 16

ייִדיש (Yiddish)

§

Pol = 17

Polski (Polish)

§

Amh = 18

አማርኛ (Amharic)

§

Jav = 19

Basa Jawa (Javanese)

§

Kor = 20

한국어 (Korean)

§

Nob = 21

Bokmål (Bokmal)

§

Dan = 22

Dansk (Danish)

§

Swe = 23

Svenska (Swedish)

§

Fin = 24

Suomi (Finnish)

§

Tur = 25

Türkçe (Turkish)

§

Nld = 26

Nederlands (Dutch)

§

Hun = 27

Magyar (Hungarian)

§

Ces = 28

Čeština (Czech)

§

Ell = 29

Ελληνικά (Greek)

§

Bul = 30

Български (Bulgarian)

§

Bel = 31

Беларуская (Belarusian)

§

Mar = 32

मराठी (Marathi)

§

Kan = 33

ಕನ್ನಡ (Kannada)

§

Ron = 34

Română (Romanian)

§

Slv = 35

Slovenščina (Slovene)

§

Hrv = 36

Hrvatski (Croatian)

§

Srp = 37

Српски (Serbian)

§

Mkd = 38

Македонски (Macedonian)

§

Lit = 39

Lietuvių (Lithuanian)

§

Lav = 40

Latviešu (Latvian)

§

Est = 41

Eesti (Estonian)

§

Tam = 42

தமிழ் (Tamil)

§

Vie = 43

Tiếng Việt (Vietnamese)

§

Urd = 44

اُردُو (Urdu)

§

Tha = 45

ภาษาไทย (Thai)

§

Guj = 46

ગુજરાતી (Gujarati)

§

Uzb = 47

Oʻzbekcha (Uzbek)

§

Pan = 48

ਪੰਜਾਬੀ (Punjabi)

§

Aze = 49

Azərbaycanca (Azerbaijani)

§

Ind = 50

Bahasa Indonesia (Indonesian)

§

Tel = 51

తెలుగు (Telugu)

§

Pes = 52

فارسی (Persian)

§

Mal = 53

മലയാളം (Malayalam)

§

Ori = 54

ଓଡ଼ିଆ (Oriya)

§

Mya = 55

မြန်မာစာ (Burmese)

§

Nep = 56

नेपाली (Nepali)

§

Sin = 57

සිංහල (Sinhalese)

§

Khm = 58

ភាសាខ្មែរ (Khmer)

§

Tuk = 59

Türkmençe (Turkmen)

§

Aka = 60

Akan (Akan)

§

Zul = 61

IsiZulu (Zulu)

§

Sna = 62

ChiShona (Shona)

§

Afr = 63

Afrikaans (Afrikaans)

§

Lat = 64

Lingua Latina (Latin)

§

Slk = 65

Slovenčina (Slovak)

§

Cat = 66

Català (Catalan)

§

Tgl = 67

Tagalog (Tagalog)

§

Hye = 68

Հայերեն (Armenian)

Implementations§

source§

impl Lang

source

pub fn from_code<S: Into<String>>(code: S) -> Option<Lang>

Get enum by ISO 639-3 code as a string.

Example
use whatlang::Lang;
assert_eq!(Lang::from_code("ukr"), Some(Lang::Ukr));
source

pub fn code(&self) -> &'static str

Convert enum into ISO 639-3 code as a string.

Example
use whatlang::Lang;
assert_eq!(Lang::Ukr.code(), "ukr");
source

pub fn name(self) -> &'static str

Get a language name in the language itself.

Example
use whatlang::Lang;
assert_eq!(Lang::Ukr.name(), "Українська");
source

pub fn eng_name(self) -> &'static str

Get a human readable name of the language in English.

Example
use whatlang::Lang;
assert_eq!(Lang::Deu.eng_name(), "German");
source

pub fn all() -> &'static [Lang]

Get all existing languages.

Example
use whatlang::Lang;
for lang in Lang::all() {
    println!("{}", lang);
}

Trait Implementations§

source§

impl Clone for Lang

source§

fn clone(&self) -> Lang

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Lang

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Lang

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromStr for Lang

§

type Err = ParseError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for Lang

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Lang

source§

fn eq(&self, other: &Lang) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Lang

source§

impl Eq for Lang

source§

impl StructuralEq for Lang

source§

impl StructuralPartialEq for Lang

Auto Trait Implementations§

§

impl RefUnwindSafe for Lang

§

impl Send for Lang

§

impl Sync for Lang

§

impl Unpin for Lang

§

impl UnwindSafe for Lang

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.