Alpha2

Enum Alpha2 

Source
#[non_exhaustive]
pub enum Alpha2 {
Show 291 variants Afghanistan, Albania, Antarctica, Algeria, AmericanSamoa, Andorra, Angola, AntiguaAndBarbuda, Azerbaijan, Argentina, Australia, Austria, Bahamas, Bahrain, Bangladesh, Armenia, Barbados, Belgium, Bermuda, Bhutan, Bolivia, BosniaAndHerzegovina, Botswana, BouvetIsland, Brazil, Belize, BritishIndianOceanTerritory, SolomonIslands, BritishVirginIslands, BruneiDarussalam, Bulgaria, Myanmar, Burundi, Belarus, Cambodia, Cameroon, Canada, CaboVerde, CaymanIslands, CentralAfricanRepublic, SriLanka, Chad, Chile, China, Taiwan, ChristmasIsland, CocosKeelingIslands, Colombia, Comoros, Mayotte, Congo, DemocraticRepublicOfTheCongo, CookIslands, CostaRica, Croatia, Cuba, Cyprus, Czechia, Benin, Denmark, Dominica, DominicanRepublic, Ecuador, ElSalvador, EquatorialGuinea, Ethiopia, Eritrea, Estonia, FaroeIslands, FalklandIslandsMalvinas, SouthGeorgiaAndTheSouthSandwichIslands, Fiji, Finland, AlandIslands, France, FrenchGuiana, FrenchPolynesia, FrenchSouthernTerritories, Djibouti, Gabon, Georgia, Gambia, Palestine, Germany, Ghana, Gibraltar, Kiribati, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guinea, Guyana, Haiti, HeardIslandAndMcDonaldIslands, HolySee, Honduras, HongKong, Hungary, Iceland, India, Indonesia, Iran, Iraq, Ireland, Israel, Italy, CoteDIvoire, Jamaica, Japan, Kazakhstan, Jordan, Kenya, NorthKorea, SouthKorea, Kuwait, Kyrgyzstan, Laos, Lebanon, Lesotho, Latvia, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, Martinique, Mauritania, Mauritius, Mexico, Monaco, Mongolia, Moldova, Montenegro, Montserrat, Morocco, Mozambique, Oman, Namibia, Nauru, Nepal, Netherlands, Curacao, Aruba, SintMaartenDutchPart, BonaireSintEustatiusAndSaba, NewCaledonia, Vanuatu, NewZealand, Nicaragua, Niger, Nigeria, Niue, NorfolkIsland, Norway, NorthernMarianaIslands, UnitedStatesMinorOutlyingIslands, Micronesia, MarshallIslands, Palau, Pakistan, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Pitcairn, Poland, Portugal, GuineaBissau, TimorLeste, PuertoRico, Qatar, Reunion, Romania, Russia, Rwanda, SaintBarthelemy, SaintHelenaAscensionAndTristanDaCunha, SaintKittsAndNevis, Anguilla, SaintLucia, SaintMartinFrenchPart, SaintPierreAndMiquelon, SaintVincentAndTheGrenadines, SanMarino, SaoTomeAndPrincipe, SaudiArabia, Senegal, Serbia, Seychelles, SierraLeone, Singapore, Slovakia, VietNam, Slovenia, Somalia, SouthAfrica, Zimbabwe, Spain, SouthSudan, Sudan, WesternSahara, Suriname, SvalbardAndJanMayen, Eswatini, Sweden, Switzerland, Syria, Tajikistan, Thailand, Togo, Tokelau, Tonga, TrinidadAndTobago, UnitedArabEmirates, Tunisia, Turkey, Turkmenistan, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, NorthMacedonia, Egypt, UnitedKingdom, Guernsey, Jersey, IsleOfMan, Tanzania, UnitedStatesOfAmerica, VirginIslandsUS, BurkinaFaso, Uruguay, Uzbekistan, Venezuela, WallisAndFutuna, Samoa, Yemen, Zambia, UserAA, UserQM, UserQN, UserQO, UserQP, UserQQ, UserQR, UserQS, UserQT, UserQU, UserQV, UserQW, UserQX, UserQY, UserQZ, UserXA, UserXB, UserXC, UserXD, UserXE, UserXF, UserXG, UserXH, UserXI, UserXJ, UserXK, UserXL, UserXM, UserXN, UserXO, UserXP, UserXQ, UserXR, UserXS, UserXT, UserXU, UserXV, UserXW, UserXX, UserXY, UserXZ, UserZZ,
}
Expand description

ISO 3166-1 Alpha-2 Country Codes.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Afghanistan

Afghanistan (004, AF, AFG)

§

Albania

Albania (008, AL, ALB)

§

Antarctica

Antarctica (010, AQ, ATA)

§

Algeria

Algeria (012, DZ, DZA)

§

AmericanSamoa

American Samoa (016, AS, ASM)

§

Andorra

Andorra (020, AD, AND)

§

Angola

Angola (024, AO, AGO)

§

AntiguaAndBarbuda

Antigua and Barbuda (028, AG, ATG)

§

Azerbaijan

Azerbaijan (031, AZ, AZE)

§

Argentina

Argentina (032, AR, ARG)

§

Australia

Australia (036, AU, AUS)

§

Austria

Austria (040, AT, AUT)

§

Bahamas

Bahamas (044, BS, BHS)

§

Bahrain

Bahrain (048, BH, BHR)

§

Bangladesh

Bangladesh (050, BD, BGD)

§

Armenia

Armenia (051, AM, ARM)

§

Barbados

Barbados (052, BB, BRB)

§

Belgium

Belgium (056, BE, BEL)

§

Bermuda

Bermuda (060, BM, BMU)

§

Bhutan

Bhutan (064, BT, BTN)

§

Bolivia

Bolivia, Plurinational State of (068, BO, BOL)

§

BosniaAndHerzegovina

Bosnia and Herzegovina (070, BA, BIH)

§

Botswana

Botswana (072, BW, BWA)

§

BouvetIsland

Bouvet Island (074, BV, BVT)

§

Brazil

Brazil (076, BR, BRA)

§

Belize

Belize (084, BZ, BLZ)

§

BritishIndianOceanTerritory

British Indian Ocean Territory (086, IO, IOT)

§

SolomonIslands

Solomon Islands (090, SB, SLB)

§

BritishVirginIslands

Virgin Islands (British) (092, VG, VGB)

§

BruneiDarussalam

Brunei Darussalam (096, BN, BRN)

§

Bulgaria

Bulgaria (100, BG, BGR)

§

Myanmar

Myanmar (104, MM, MMR)

§

Burundi

Burundi (108, BI, BDI)

§

Belarus

Belarus (112, BY, BLR)

§

Cambodia

Cambodia (116, KH, KHM)

§

Cameroon

Cameroon (120, CM, CMR)

§

Canada

Canada (124, CA, CAN)

§

CaboVerde

Cabo Verde (132, CV, CPV)

§

CaymanIslands

Cayman Islands (136, KY, CYM)

§

CentralAfricanRepublic

Central African Republic (140, CF, CAF)

§

SriLanka

Sri Lanka (144, LK, LKA)

§

Chad

Chad (148, TD, TCD)

§

Chile

Chile (152, CL, CHL)

§

China

China (156, CN, CHN)

§

Taiwan

Taiwan, Province of China (158, TW, TWN)

§

ChristmasIsland

Christmas Island (162, CX, CXR)

§

CocosKeelingIslands

Cocos (Keeling) Islands (166, CC, CCK)

§

Colombia

Colombia (170, CO, COL)

§

Comoros

Comoros (174, KM, COM)

§

Mayotte

Mayotte (175, YT, MYT)

§

Congo

Congo (178, CG, COG)

§

DemocraticRepublicOfTheCongo

Congo, Democratic Republic of the (180, CD, COD)

§

CookIslands

Cook Islands (184, CK, COK)

§

CostaRica

Costa Rica (188, CR, CRI)

§

Croatia

Croatia (191, HR, HRV)

§

Cuba

Cuba (192, CU, CUB)

§

Cyprus

Cyprus (196, CY, CYP)

§

Czechia

Czechia (203, CZ, CZE)

§

Benin

Benin (204, BJ, BEN)

§

Denmark

Denmark (208, DK, DNK)

§

Dominica

Dominica (212, DM, DMA)

§

DominicanRepublic

Dominican Republic (214, DO, DOM)

§

Ecuador

Ecuador (218, EC, ECU)

§

ElSalvador

El Salvador (222, SV, SLV)

§

EquatorialGuinea

Equatorial Guinea (226, GQ, GNQ)

§

Ethiopia

Ethiopia (231, ET, ETH)

§

Eritrea

Eritrea (232, ER, ERI)

§

Estonia

Estonia (233, EE, EST)

§

FaroeIslands

Faroe Islands (234, FO, FRO)

§

FalklandIslandsMalvinas

Falkland Islands (Malvinas) (238, FK, FLK)

§

SouthGeorgiaAndTheSouthSandwichIslands

South Georgia and the South Sandwich Islands (239, GS, SGS)

§

Fiji

Fiji (242, FJ, FJI)

§

Finland

Finland (246, FI, FIN)

§

AlandIslands

Åland Islands (248, AX, ALA)

§

France

France (250, FR, FRA)

§

FrenchGuiana

French Guiana (254, GF, GUF)

§

FrenchPolynesia

French Polynesia (258, PF, PYF)

§

FrenchSouthernTerritories

French Southern Territories (260, TF, ATF)

§

Djibouti

Djibouti (262, DJ, DJI)

§

Gabon

Gabon (266, GA, GAB)

§

Georgia

Georgia (268, GE, GEO)

§

Gambia

Gambia (270, GM, GMB)

§

Palestine

Palestine, State of (275, PS, PSE)

§

Germany

Germany (276, DE, DEU)

§

Ghana

Ghana (288, GH, GHA)

§

Gibraltar

Gibraltar (292, GI, GIB)

§

Kiribati

Kiribati (296, KI, KIR)

§

Greece

Greece (300, GR, GRC)

§

Greenland

Greenland (304, GL, GRL)

§

Grenada

Grenada (308, GD, GRD)

§

Guadeloupe

Guadeloupe (312, GP, GLP)

§

Guam

Guam (316, GU, GUM)

§

Guatemala

Guatemala (320, GT, GTM)

§

Guinea

Guinea (324, GN, GIN)

§

Guyana

Guyana (328, GY, GUY)

§

Haiti

Haiti (332, HT, HTI)

§

HeardIslandAndMcDonaldIslands

Heard Island and McDonald Islands (334, HM, HMD)

§

HolySee

Holy See (336, VA, VAT)

§

Honduras

Honduras (340, HN, HND)

§

HongKong

Hong Kong (344, HK, HKG)

§

Hungary

Hungary (348, HU, HUN)

§

Iceland

Iceland (352, IS, ISL)

§

India

India (356, IN, IND)

§

Indonesia

Indonesia (360, ID, IDN)

§

Iran

Iran, Islamic Republic of (364, IR, IRN)

§

Iraq

Iraq (368, IQ, IRQ)

§

Ireland

Ireland (372, IE, IRL)

§

Israel

Israel (376, IL, ISR)

§

Italy

Italy (380, IT, ITA)

§

CoteDIvoire

Côte d’Ivoire (384, CI, CIV)

§

Jamaica

Jamaica (388, JM, JAM)

§

Japan

Japan (392, JP, JPN)

§

Kazakhstan

Kazakhstan (398, KZ, KAZ)

§

Jordan

Jordan (400, JO, JOR)

§

Kenya

Kenya (404, KE, KEN)

§

NorthKorea

Korea, Democratic People’s Republic of (408, KP, PRK)

§

SouthKorea

Korea, Republic of (410, KR, KOR)

§

Kuwait

Kuwait (414, KW, KWT)

§

Kyrgyzstan

Kyrgyzstan (417, KG, KGZ)

§

Laos

Lao People’s Democratic Republic (418, LA, LAO)

§

Lebanon

Lebanon (422, LB, LBN)

§

Lesotho

Lesotho (426, LS, LSO)

§

Latvia

Latvia (428, LV, LVA)

§

Liberia

Liberia (430, LR, LBR)

§

Libya

Libya (434, LY, LBY)

§

Liechtenstein

Liechtenstein (438, LI, LIE)

§

Lithuania

Lithuania (440, LT, LTU)

§

Luxembourg

Luxembourg (442, LU, LUX)

§

Macao

Macao (446, MO, MAC)

§

Madagascar

Madagascar (450, MG, MDG)

§

Malawi

Malawi (454, MW, MWI)

§

Malaysia

Malaysia (458, MY, MYS)

§

Maldives

Maldives (462, MV, MDV)

§

Mali

Mali (466, ML, MLI)

§

Malta

Malta (470, MT, MLT)

§

Martinique

Martinique (474, MQ, MTQ)

§

Mauritania

Mauritania (478, MR, MRT)

§

Mauritius

Mauritius (480, MU, MUS)

§

Mexico

Mexico (484, MX, MEX)

§

Monaco

Monaco (492, MC, MCO)

§

Mongolia

Mongolia (496, MN, MNG)

§

Moldova

Moldova, Republic of (498, MD, MDA)

§

Montenegro

Montenegro (499, ME, MNE)

§

Montserrat

Montserrat (500, MS, MSR)

§

Morocco

Morocco (504, MA, MAR)

§

Mozambique

Mozambique (508, MZ, MOZ)

§

Oman

Oman (512, OM, OMN)

§

Namibia

Namibia (516, NA, NAM)

§

Nauru

Nauru (520, NR, NRU)

§

Nepal

Nepal (524, NP, NPL)

§

Netherlands

Netherlands, Kingdom of the (528, NL, NLD)

§

Curacao

Curaçao (531, CW, CUW)

§

Aruba

Aruba (533, AW, ABW)

§

SintMaartenDutchPart

Sint Maarten (Dutch part) (534, SX, SXM)

§

BonaireSintEustatiusAndSaba

Bonaire, Sint Eustatius and Saba (535, BQ, BES)

§

NewCaledonia

New Caledonia (540, NC, NCL)

§

Vanuatu

Vanuatu (548, VU, VUT)

§

NewZealand

New Zealand (554, NZ, NZL)

§

Nicaragua

Nicaragua (558, NI, NIC)

§

Niger

Niger (562, NE, NER)

§

Nigeria

Nigeria (566, NG, NGA)

§

Niue

Niue (570, NU, NIU)

§

NorfolkIsland

Norfolk Island (574, NF, NFK)

§

Norway

Norway (578, NO, NOR)

§

NorthernMarianaIslands

Northern Mariana Islands (580, MP, MNP)

§

UnitedStatesMinorOutlyingIslands

United States Minor Outlying Islands (581, UM, UMI)

§

Micronesia

Micronesia, Federated States of (583, FM, FSM)

§

MarshallIslands

Marshall Islands (584, MH, MHL)

§

Palau

Palau (585, PW, PLW)

§

Pakistan

Pakistan (586, PK, PAK)

§

Panama

Panama (591, PA, PAN)

§

PapuaNewGuinea

Papua New Guinea (598, PG, PNG)

§

Paraguay

Paraguay (600, PY, PRY)

§

Peru

Peru (604, PE, PER)

§

Philippines

Philippines (608, PH, PHL)

§

Pitcairn

Pitcairn (612, PN, PCN)

§

Poland

Poland (616, PL, POL)

§

Portugal

Portugal (620, PT, PRT)

§

GuineaBissau

Guinea-Bissau (624, GW, GNB)

§

TimorLeste

Timor-Leste (626, TL, TLS)

§

PuertoRico

Puerto Rico (630, PR, PRI)

§

Qatar

Qatar (634, QA, QAT)

§

Reunion

Réunion (638, RE, REU)

§

Romania

Romania (642, RO, ROU)

§

Russia

Russian Federation (643, RU, RUS)

§

Rwanda

Rwanda (646, RW, RWA)

§

SaintBarthelemy

Saint Barthélemy (652, BL, BLM)

§

SaintHelenaAscensionAndTristanDaCunha

Saint Helena, Ascension and Tristan da Cunha (654, SH, SHN)

§

SaintKittsAndNevis

Saint Kitts and Nevis (659, KN, KNA)

§

Anguilla

Anguilla (660, AI, AIA)

§

SaintLucia

Saint Lucia (662, LC, LCA)

§

SaintMartinFrenchPart

Saint Martin (French part) (663, MF, MAF)

§

SaintPierreAndMiquelon

Saint Pierre and Miquelon (666, PM, SPM)

§

SaintVincentAndTheGrenadines

Saint Vincent and the Grenadines (670, VC, VCT)

§

SanMarino

San Marino (674, SM, SMR)

§

SaoTomeAndPrincipe

Sao Tome and Principe (678, ST, STP)

§

SaudiArabia

Saudi Arabia (682, SA, SAU)

§

Senegal

Senegal (686, SN, SEN)

§

Serbia

Serbia (688, RS, SRB)

§

Seychelles

Seychelles (690, SC, SYC)

§

SierraLeone

Sierra Leone (694, SL, SLE)

§

Singapore

Singapore (702, SG, SGP)

§

Slovakia

Slovakia (703, SK, SVK)

§

VietNam

Viet Nam (704, VN, VNM)

§

Slovenia

Slovenia (705, SI, SVN)

§

Somalia

Somalia (706, SO, SOM)

§

SouthAfrica

South Africa (710, ZA, ZAF)

§

Zimbabwe

Zimbabwe (716, ZW, ZWE)

§

Spain

Spain (724, ES, ESP)

§

SouthSudan

South Sudan (728, SS, SSD)

§

Sudan

Sudan (729, SD, SDN)

§

WesternSahara

Western Sahara (732, EH, ESH)

§

Suriname

Suriname (740, SR, SUR)

§

SvalbardAndJanMayen

Svalbard and Jan Mayen (744, SJ, SJM)

§

Eswatini

Eswatini (748, SZ, SWZ)

§

Sweden

Sweden (752, SE, SWE)

§

Switzerland

Switzerland (756, CH, CHE)

§

Syria

Syrian Arab Republic (760, SY, SYR)

§

Tajikistan

Tajikistan (762, TJ, TJK)

§

Thailand

Thailand (764, TH, THA)

§

Togo

Togo (768, TG, TGO)

§

Tokelau

Tokelau (772, TK, TKL)

§

Tonga

Tonga (776, TO, TON)

§

TrinidadAndTobago

Trinidad and Tobago (780, TT, TTO)

§

UnitedArabEmirates

United Arab Emirates (784, AE, ARE)

§

Tunisia

Tunisia (788, TN, TUN)

§

Turkey

Türkiye (792, TR, TUR)

§

Turkmenistan

Turkmenistan (795, TM, TKM)

§

TurksAndCaicosIslands

Turks and Caicos Islands (796, TC, TCA)

§

Tuvalu

Tuvalu (798, TV, TUV)

§

Uganda

Uganda (800, UG, UGA)

§

Ukraine

Ukraine (804, UA, UKR)

§

NorthMacedonia

North Macedonia (807, MK, MKD)

§

Egypt

Egypt (818, EG, EGY)

§

UnitedKingdom

United Kingdom of Great Britain and Northern Ireland (826, GB, GBR)

§

Guernsey

Guernsey (831, GG, GGY)

§

Jersey

Jersey (832, JE, JEY)

§

IsleOfMan

Isle of Man (833, IM, IMN)

§

Tanzania

Tanzania, United Republic of (834, TZ, TZA)

§

UnitedStatesOfAmerica

United States of America (840, US, USA)

§

VirginIslandsUS

Virgin Islands (U.S.) (850, VI, VIR)

§

BurkinaFaso

Burkina Faso (854, BF, BFA)

§

Uruguay

Uruguay (858, UY, URY)

§

Uzbekistan

Uzbekistan (860, UZ, UZB)

§

Venezuela

Venezuela, Bolivarian Republic of (862, VE, VEN)

§

WallisAndFutuna

Wallis and Futuna (876, WF, WLF)

§

Samoa

Samoa (882, WS, WSM)

§

Yemen

Yemen (887, YE, YEM)

§

Zambia

Zambia (894, ZM, ZMB)

§

UserAA

User-assigned AA

§

UserQM

User-assigned QM

§

UserQN

User-assigned QN

§

UserQO

User-assigned QO

§

UserQP

User-assigned QP

§

UserQQ

User-assigned QQ

§

UserQR

User-assigned QR

§

UserQS

User-assigned QS

§

UserQT

User-assigned QT

§

UserQU

User-assigned QU

§

UserQV

User-assigned QV

§

UserQW

User-assigned QW

§

UserQX

User-assigned QX

§

UserQY

User-assigned QY

§

UserQZ

User-assigned QZ

§

UserXA

User-assigned XA

§

UserXB

User-assigned XB

§

UserXC

User-assigned XC

§

UserXD

User-assigned XD

§

UserXE

User-assigned XE

§

UserXF

User-assigned XF

§

UserXG

User-assigned XG

§

UserXH

User-assigned XH

§

UserXI

User-assigned XI

§

UserXJ

User-assigned XJ

§

UserXK

User-assigned XK

§

UserXL

User-assigned XL

§

UserXM

User-assigned XM

§

UserXN

User-assigned XN

§

UserXO

User-assigned XO

§

UserXP

User-assigned XP

§

UserXQ

User-assigned XQ

§

UserXR

User-assigned XR

§

UserXS

User-assigned XS

§

UserXT

User-assigned XT

§

UserXU

User-assigned XU

§

UserXV

User-assigned XV

§

UserXW

User-assigned XW

§

UserXX

User-assigned XX

§

UserXY

User-assigned XY

§

UserXZ

User-assigned XZ

§

UserZZ

User-assigned ZZ

Implementations§

Source§

impl Alpha2

Source

pub const fn from_str_slice(value: &str) -> Result<Self, Error>

Parse the given alpha-2 string slice into the enum value.

§Errors
Source

pub const fn from_numeric(value: Numeric) -> Result<Self, Error>

Try to convert the given numeric value into the alpha-2 value.

§Errors
Source

pub const fn from_alpha3(value: Alpha3) -> Result<Self, Error>

Try to convert the given alpha-3 value into the alpha-2 value.

§Errors
Source

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

Get the string representation of the given Alpha-2 code.

Source

pub const fn is_user_assigned(&self) -> bool

Determine whether a given enum value represents a user-assigned value.

§Examples
use iso3166_static::Alpha2;

assert!(!Alpha2::UnitedStatesOfAmerica.is_user_assigned());
assert!(Alpha2::UserXX.is_user_assigned());

Trait Implementations§

Source§

impl Clone for Alpha2

Source§

fn clone(&self) -> Alpha2

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 Alpha2

Source§

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

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

impl<'de> Deserialize<'de> for Alpha2

Available on crate feature serde only.
Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Alpha2

Source§

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

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

impl FromStr for Alpha2

Source§

type Err = Error

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 Alpha2

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 Alpha2

Source§

fn cmp(&self, other: &Alpha2) -> 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<Alpha2> for Alpha3

Source§

fn eq(&self, other: &Alpha2) -> 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 PartialEq<Alpha2> for Numeric

Source§

fn eq(&self, other: &Alpha2) -> 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 PartialEq<Alpha3> for Alpha2

Source§

fn eq(&self, other: &Alpha3) -> 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 PartialEq<Numeric> for Alpha2

Source§

fn eq(&self, other: &Numeric) -> 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 PartialEq for Alpha2

Source§

fn eq(&self, other: &Alpha2) -> 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 Alpha2

Source§

fn partial_cmp(&self, other: &Alpha2) -> 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 Serialize for Alpha2

Available on crate feature serde only.
Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<&str> for Alpha2

Source§

type Error = Error

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

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

Performs the conversion.
Source§

impl TryFrom<Alpha2> for Alpha3

Source§

type Error = Error

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

fn try_from(value: Alpha2) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Alpha2> for Numeric

Source§

type Error = Error

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

fn try_from(value: Alpha2) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Alpha3> for Alpha2

Source§

type Error = Error

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

fn try_from(value: Alpha3) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Numeric> for Alpha2

Source§

type Error = Error

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

fn try_from(value: Numeric) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for Alpha2

Source§

impl Eq for Alpha2

Source§

impl StructuralPartialEq for Alpha2

Auto Trait Implementations§

§

impl Freeze for Alpha2

§

impl RefUnwindSafe for Alpha2

§

impl Send for Alpha2

§

impl Sync for Alpha2

§

impl Unpin for Alpha2

§

impl UnwindSafe for Alpha2

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,