Enum LanguageCode

Source
pub enum LanguageCode {
Show 184 variants Ab, Aa, Af, Ak, Sq, Am, Ar, An, Hy, As, Av, Ae, Ay, Az, Bm, Ba, Eu, Be, Bn, Bh, Bi, Bs, Br, Bg, My, Ca, Ch, Ce, Ny, Zh, Cv, Kw, Co, Cr, Hr, Cs, Da, Dv, Nl, Dz, En, Eo, Et, Ee, Fo, Fj, Fi, Fr, Ff, Gl, Ka, De, El, Gn, Gu, Ht, Ha, He, Hz, Hi, Ho, Hu, Ia, Id, Ie, Ga, Ig, Ik, Io, Is, It, Iu, Ja, Jv, Kl, Kn, Kr, Ks, Kk, Km, Ki, Rw, Ky, Kv, Kg, Ko, Ku, Kj, La, Lb, Lg, Li, Ln, Lo, Lt, Lu, Lv, Gv, Mk, Mg, Ms, Ml, Mt, Mi, Mr, Mh, Mn, Na, Nv, Nd, Ne, Ng, Nb, Nn, No, Ii, Nr, Oc, Oj, Cu, Om, Or, Os, Pa, Pi, Fa, Pl, Ps, Pt, Qu, Rm, Rn, Ro, Ru, Sa, Sc, Sd, Se, Sm, Sg, Sr, Gd, Sn, Si, Sk, Sl, So, St, Es, Su, Sw, Ss, Sv, Ta, Te, Tg, Th, Ti, Bo, Tk, Tl, Tn, To, Tr, Ts, Tt, Tw, Ty, Ug, Uk, Ur, Uz, Ve, Vi, Vo, Wa, Cy, Wo, Fy, Xh, Yi, Yo, Za, Zu,
}
Expand description

An enumeration of all ISO 639-1 language codes.

Variants§

§

Ab

Abkhazian

§

Aa

Afar

§

Af

Afrikaans

§

Ak

Akan

§

Sq

Albanian

§

Am

Amharic

§

Ar

Arabic

§

An

Aragonese

§

Hy

Armenian

§

As

Assamese

§

Av

Avaric

§

Ae

Avestan

§

Ay

Aymara

§

Az

Azerbaijani

§

Bm

Bambara

§

Ba

Bashkir

§

Eu

Basque

§

Be

Belarusian

§

Bn

Bengali

§

Bh

Bihari languages

§

Bi

Bislama

§

Bs

Bosnian

§

Br

Breton

§

Bg

Bulgarian

§

My

Burmese

§

Ca

Catalan

§

Ch

Chamorro

§

Ce

Chechen

§

Ny

Chichewa

§

Zh

Chinese

§

Cv

Chuvash

§

Kw

Cornish

§

Co

Corsican

§

Cr

Cree

§

Hr

Croatian

§

Cs

Czech

§

Da

Danish

§

Dv

Divehi

§

Nl

Dutch

§

Dz

Dzongkha

§

En

English

§

Eo

Esperanto

§

Et

Estonian

§

Ee

Ewe

§

Fo

Faroese

§

Fj

Fijian

§

Fi

Finnish

§

Fr

French

§

Ff

Fulah

§

Gl

Galician

§

Ka

Georgian

§

De

German

§

El

Greek

§

Gn

Guarani

§

Gu

Gujarati

§

Ht

Haitian

§

Ha

Hausa

§

He

Hebrew

§

Hz

Herero

§

Hi

Hindi

§

Ho

Hiri Motu

§

Hu

Hungarian

§

Ia

Interlingua

§

Id

Indonesian

§

Ie

Interlingue

§

Ga

Irish

§

Ig

Igbo

§

Ik

Inupiaq

§

Io

Ido

§

Is

Icelandic

§

It

Italian

§

Iu

Inuktitut

§

Ja

Japanese

§

Jv

Javanese

§

Kl

Kalaallisut

§

Kn

Kannada

§

Kr

Kanuri

§

Ks

Kashmiri

§

Kk

Kazakh

§

Km

Central Khmer

§

Ki

Kikuyu

§

Rw

Kinyarwanda

§

Ky

Kirghiz

§

Kv

Komi

§

Kg

Kongo

§

Ko

Korean

§

Ku

Kurdish

§

Kj

Kuanyama

§

La

Latin

§

Lb

Luxembourgish

§

Lg

Ganda

§

Li

Limburgan

§

Ln

Lingala

§

Lo

Lao

§

Lt

Lithuanian

§

Lu

Luba-Katanga

§

Lv

Latvian

§

Gv

Manx

§

Mk

Macedonian

§

Mg

Malagasy

§

Ms

Malay

§

Ml

Malayalam

§

Mt

Maltese

§

Mi

Maori

§

Mr

Marathi

§

Mh

Marshallese

§

Mn

Mongolian

§

Na

Nauru

§

Nv

Navajo

§

Nd

North Ndebele

§

Ne

Nepali

§

Ng

Ndonga

§

Nb

Norwegian Bokmål

§

Nn

Norwegian Nynorsk

§

No

Norwegian

§

Ii

Sichuan Yi

§

Nr

South Ndebele

§

Oc

Occitan

§

Oj

Ojibwa

§

Cu

Church Slavic

§

Om

Oromo

§

Or

Oriya

§

Os

Ossetian

§

Pa

Punjabi

§

Pi

Pali

§

Fa

Persian

§

Pl

Polish

§

Ps

Pashto

§

Pt

Portuguese

§

Qu

Quechua

§

Rm

Romansh

§

Rn

Rundi

§

Ro

Romanian

§

Ru

Russian

§

Sa

Sanskrit

§

Sc

Sardinian

§

Sd

Sindhi

§

Se

Northern Sami

§

Sm

Samoan

§

Sg

Sango

§

Sr

Serbian

§

Gd

Gaelic

§

Sn

Shona

§

Si

Sinhala

§

Sk

Slovak

§

Sl

Slovenian

§

So

Somali

§

St

Southern Sotho

§

Es

Spanish

§

Su

Sundanese

§

Sw

Swahili

§

Ss

Swati

§

Sv

Swedish

§

Ta

Tamil

§

Te

Telugu

§

Tg

Tajik

§

Th

Thai

§

Ti

Tigrinya

§

Bo

Tibetan

§

Tk

Turkmen

§

Tl

Tagalog

§

Tn

Tswana

§

To

Tonga

§

Tr

Turkish

§

Ts

Tsonga

§

Tt

Tatar

§

Tw

Twi

§

Ty

Tahitian

§

Ug

Uighur

§

Uk

Ukrainian

§

Ur

Urdu

§

Uz

Uzbek

§

Ve

Venda

§

Vi

Vietnamese

§

Vo

Volapük

§

Wa

Walloon

§

Cy

Welsh

§

Wo

Wolof

§

Fy

Western Frisian

§

Xh

Xhosa

§

Yi

Yiddish

§

Yo

Yoruba

§

Za

Zhuang

§

Zu

Zulu

Implementations§

Source§

impl LanguageCode

Source

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

Returns the 2 letter code of the language.

§Examples
use isolanguage_1::LanguageCode;

assert_eq!(LanguageCode::Vi.code(), "vi");
Source

pub const fn code_t(self) -> &'static str

Returns the 3 letter ISO 639-2 T code of the language (preferred over the B code).

§Examples
use isolanguage_1::LanguageCode;

assert_eq!(LanguageCode::Nl.code_t(), "nld");
Source

pub const fn code_b(self) -> &'static str

Returns the 3 letter ISO 639-2 B code of the language (the T code is preferred).

§Examples
use isolanguage_1::LanguageCode;

assert_eq!(LanguageCode::Nl.code_b(), "dut");
Source

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

Returns the ISO language name.

§Examples
use isolanguage_1::LanguageCode;

assert_eq!(LanguageCode::Cs.name(), "Czech");
Source

pub const fn family(self) -> &'static str

Returns the ISO family of the language.

§Examples
use isolanguage_1::LanguageCode;

assert_eq!(LanguageCode::Kk.family(), "Turkic");
assert_eq!(LanguageCode::Vo.family(), "Constructed");
Source§

impl LanguageCode

Source

pub fn iter() -> Iter

Returns an iterator over every ISO 639-1 language code.

§Example
use isolanguage_1::LanguageCode;

assert!(LanguageCode::iter().find(|&code| code == LanguageCode::Wo).is_some());
Source

pub fn codes() -> Codes

Returns an iterator over all 2-letter language codes.

§Example
use isolanguage_1::LanguageCode;

assert!(LanguageCode::codes().find(|code| *code == "en").is_some());
Source

pub fn codes_t() -> CodesT

Returns an iterator over all 3 letter ISO 639-2 T codes.

§Example
use isolanguage_1::LanguageCode;

assert!(LanguageCode::codes_t().find(|code| *code == "ave").is_some());
Source

pub fn codes_b() -> CodesB

Returns an iterator over all 3 letter ISO 639-2 B codes.

§Example
use isolanguage_1::LanguageCode;

assert!(LanguageCode::codes_b().find(|code| *code == "chi").is_some());
Source

pub fn families() -> Families

Returns an iterator over all language families.

§Example
use isolanguage_1::LanguageCode;

assert!(LanguageCode::families().find(|family| *family == "Algonquian").is_some());

Trait Implementations§

Source§

impl Clone for LanguageCode

Source§

fn clone(&self) -> LanguageCode

Returns a duplicate 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 LanguageCode

Source§

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

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

impl Display for LanguageCode

Source§

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

Writes the ISO language name.

Source§

impl FromStr for LanguageCode

Source§

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

Calls TryFrom.

Source§

type Err = ParseError

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

impl Hash for LanguageCode

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 Ord for LanguageCode

Source§

fn cmp(&self, other: &LanguageCode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for LanguageCode

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for LanguageCode

Source§

fn partial_cmp(&self, other: &LanguageCode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl TryFrom<&str> for LanguageCode

Source§

fn try_from(s: &str) -> Result<Self, Self::Error>

Tries to convert from a two letter language code.

Source§

type Error = ParseError

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

impl Copy for LanguageCode

Source§

impl Eq for LanguageCode

Source§

impl StructuralPartialEq for LanguageCode

Auto Trait Implementations§

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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§

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>,

Source§

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>,

Source§

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.