CountryCode

Enum CountryCode 

Source
#[non_exhaustive]
#[repr(u16)]
pub enum CountryCode {
Show 498 variants AD = 20, AE = 784, AF = 4, AG = 28, AI = 660, AL = 8, AM = 51, AO = 24, AQ = 10, AR = 32, AS = 16, AT = 40, AU = 36, AW = 533, AX = 248, AZ = 31, BA = 70, BB = 52, BD = 50, BE = 56, BF = 854, BG = 100, BH = 48, BI = 108, BJ = 204, BL = 652, BM = 60, BN = 96, BO = 68, BQ = 535, BR = 76, BS = 44, BT = 64, BV = 74, BW = 72, BY = 112, BZ = 84, CA = 124, CC = 166, CD = 180, CF = 140, CG = 178, CH = 756, CI = 384, CK = 184, CL = 152, CM = 120, CN = 156, CO = 170, CR = 188, CU = 192, CV = 132, CW = 531, CX = 162, CY = 196, CZ = 203, DE = 276, DJ = 262, DK = 208, DM = 212, DO = 214, DZ = 12, EC = 218, EE = 233, EG = 818, EH = 732, ER = 232, ES = 724, ET = 231, FI = 246, FJ = 242, FK = 238, FM = 583, FO = 234, FR = 250, GA = 266, GB = 826, GD = 308, GE = 268, GF = 254, GG = 831, GH = 288, GI = 292, GL = 304, GM = 270, GN = 324, GP = 312, GQ = 226, GR = 300, GS = 239, GT = 320, GU = 316, GW = 624, GY = 328, HK = 344, HM = 334, HN = 340, HR = 191, HT = 332, HU = 348, ID = 360, IE = 372, IL = 376, IM = 833, IN = 356, IO = 86, IQ = 368, IR = 364, IS = 352, IT = 380, JE = 832, JM = 388, JO = 400, JP = 392, KE = 404, KG = 417, KH = 116, KI = 296, KM = 174, KN = 659, KP = 408, KR = 410, KW = 414, KY = 136, KZ = 398, LA = 418, LB = 422, LC = 662, LI = 438, LK = 144, LR = 430, LS = 426, LT = 440, LU = 442, LV = 428, LY = 434, MA = 504, MC = 492, MD = 498, ME = 499, MF = 663, MG = 450, MH = 584, MK = 807, ML = 466, MM = 104, MN = 496, MO = 446, MP = 580, MQ = 474, MR = 478, MS = 500, MT = 470, MU = 480, MV = 462, MW = 454, MX = 484, MY = 458, MZ = 508, NA = 516, NC = 540, NE = 562, NF = 574, NG = 566, NI = 558, NL = 528, NO = 578, NP = 524, NR = 520, NU = 570, NZ = 554, OM = 512, PA = 591, PE = 604, PF = 258, PG = 598, PH = 608, PK = 586, PL = 616, PM = 666, PN = 612, PR = 630, PS = 275, PT = 620, PW = 585, PY = 600, QA = 634, RE = 638, RO = 642, RS = 688, RU = 643, RW = 646, SA = 682, SB = 90, SC = 690, SD = 729, SE = 752, SG = 702, SH = 654, SI = 705, SJ = 744, SK = 703, SL = 694, SM = 674, SN = 686, SO = 706, SR = 740, SS = 728, ST = 678, SV = 222, SX = 534, SY = 760, SZ = 748, TC = 796, TD = 148, TF = 260, TG = 768, TH = 764, TJ = 762, TK = 772, TL = 626, TM = 795, TN = 788, TO = 776, TR = 792, TT = 780, TV = 798, TW = 158, TZ = 834, UA = 804, UG = 800, UM = 581, US = 840, UY = 858, UZ = 860, VA = 336, VC = 670, VE = 862, VG = 92, VI = 850, VN = 704, VU = 548, WF = 876, WS = 882, YE = 887, YT = 175, ZA = 710, ZM = 894, ZW = 716, ABW = 1_533, AFG = 1_004, AGO = 1_024, AIA = 1_660, ALA = 1_248, ALB = 1_008, AND = 1_020, ARE = 1_784, ARG = 1_032, ARM = 1_051, ASM = 1_016, ATA = 1_010, ATF = 1_260, ATG = 1_028, AUS = 1_036, AUT = 1_040, AZE = 1_031, BDI = 1_108, BEL = 1_056, BEN = 1_204, BES = 1_535, BFA = 1_854, BGD = 1_050, BGR = 1_100, BHR = 1_048, BHS = 1_044, BIH = 1_070, BLM = 1_652, BLR = 1_112, BLZ = 1_084, BMU = 1_060, BOL = 1_068, BRA = 1_076, BRB = 1_052, BRN = 1_096, BTN = 1_064, BVT = 1_074, BWA = 1_072, CAF = 1_140, CAN = 1_124, CCK = 1_166, CHE = 1_756, CHL = 1_152, CHN = 1_156, CIV = 1_384, CMR = 1_120, COD = 1_180, COG = 1_178, COK = 1_184, COL = 1_170, COM = 1_174, CPV = 1_132, CRI = 1_188, CUB = 1_192, CUW = 1_531, CXR = 1_162, CYM = 1_136, CYP = 1_196, CZE = 1_203, DEU = 1_276, DJI = 1_262, DMA = 1_212, DNK = 1_208, DOM = 1_214, DZA = 1_012, ECU = 1_218, EGY = 1_818, ERI = 1_232, ESH = 1_732, ESP = 1_724, EST = 1_233, ETH = 1_231, FIN = 1_246, FJI = 1_242, FLK = 1_238, FRA = 1_250, FRO = 1_234, FSM = 1_583, GAB = 1_266, GBR = 1_826, GEO = 1_268, GGY = 1_831, GHA = 1_288, GIB = 1_292, GIN = 1_324, GLP = 1_312, GMB = 1_270, GNB = 1_624, GNQ = 1_226, GRC = 1_300, GRD = 1_308, GRL = 1_304, GTM = 1_320, GUF = 1_254, GUM = 1_316, GUY = 1_328, HKG = 1_344, HMD = 1_334, HND = 1_340, HRV = 1_191, HTI = 1_332, HUN = 1_348, IDN = 1_360, IMN = 1_833, IND = 1_356, IOT = 1_086, IRL = 1_372, IRN = 1_364, IRQ = 1_368, ISL = 1_352, ISR = 1_376, ITA = 1_380, JAM = 1_388, JEY = 1_832, JOR = 1_400, JPN = 1_392, KAZ = 1_398, KEN = 1_404, KGZ = 1_417, KHM = 1_116, KIR = 1_296, KNA = 1_659, KOR = 1_410, KWT = 1_414, LAO = 1_418, LBN = 1_422, LBR = 1_430, LBY = 1_434, LCA = 1_662, LIE = 1_438, LKA = 1_144, LSO = 1_426, LTU = 1_440, LUX = 1_442, LVA = 1_428, MAC = 1_446, MAF = 1_663, MAR = 1_504, MCO = 1_492, MDA = 1_498, MDG = 1_450, MDV = 1_462, MEX = 1_484, MHL = 1_584, MKD = 1_807, MLI = 1_466, MLT = 1_470, MMR = 1_104, MNE = 1_499, MNG = 1_496, MNP = 1_580, MOZ = 1_508, MRT = 1_478, MSR = 1_500, MTQ = 1_474, MUS = 1_480, MWI = 1_454, MYS = 1_458, MYT = 1_175, NAM = 1_516, NCL = 1_540, NER = 1_562, NFK = 1_574, NGA = 1_566, NIC = 1_558, NIU = 1_570, NLD = 1_528, NOR = 1_578, NPL = 1_524, NRU = 1_520, NZL = 1_554, OMN = 1_512, PAK = 1_586, PAN = 1_591, PCN = 1_612, PER = 1_604, PHL = 1_608, PLW = 1_585, PNG = 1_598, POL = 1_616, PRI = 1_630, PRK = 1_408, PRT = 1_620, PRY = 1_600, PSE = 1_275, PYF = 1_258, QAT = 1_634, REU = 1_638, ROU = 1_642, RUS = 1_643, RWA = 1_646, SAU = 1_682, SDN = 1_729, SEN = 1_686, SGP = 1_702, SGS = 1_239, SHN = 1_654, SJM = 1_744, SLB = 1_090, SLE = 1_694, SLV = 1_222, SMR = 1_674, SOM = 1_706, SPM = 1_666, SRB = 1_688, SSD = 1_728, STP = 1_678, SUR = 1_740, SVK = 1_703, SVN = 1_705, SWE = 1_752, SWZ = 1_748, SXM = 1_534, SYC = 1_690, SYR = 1_760, TCA = 1_796, TCD = 1_148, TGO = 1_768, THA = 1_764, TJK = 1_762, TKL = 1_772, TKM = 1_795, TLS = 1_626, TON = 1_776, TTO = 1_780, TUN = 1_788, TUR = 1_792, TUV = 1_798, TWN = 1_158, TZA = 1_834, UGA = 1_800, UKR = 1_804, UMI = 1_581, URY = 1_858, USA = 1_840, UZB = 1_860, VAT = 1_336, VCT = 1_670, VEN = 1_862, VGB = 1_092, VIR = 1_850, VNM = 1_704, VUT = 1_548, WLF = 1_876, WSM = 1_882, YEM = 1_887, ZAF = 1_710, ZMB = 1_894, ZWE = 1_716,
}
Expand description

The possible countries’ codes.

These codes are based on the ISO 3166 standard, specifically ISO 3166-1, which defines codes of two and three characters to represent countries and territories. There are both alphabetic and numeric codes, using either two letters, three letters, or three numbers.

§Alphabetic codes

The alphabetic codes are defined by the ISO 3166-1 alpha-2 set, which is the most widely-used of the three sets; and the ISO 3166-1 alpha-3 set, which is less widely-used but gives better visual association between the codes and country names than the alpha-2 set.

§Numeric codes

The three-digit numeric code is a useful alternative when the letter-based code may not be appropriate.

§Data sources

The list of codes is available from the ISO site, and from Wikipedia.

§See also

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

AD = 20

Andorra

§

AE = 784

United Arab Emirates

§

AF = 4

Afghanistan

§

AG = 28

Antigua and Barbuda

§

AI = 660

Anguilla

§

AL = 8

Albania

§

AM = 51

Armenia

§

AO = 24

Angola

§

AQ = 10

Antarctica

§

AR = 32

Argentina

§

AS = 16

American Samoa

§

AT = 40

Austria

§

AU = 36

Australia

§

AW = 533

Aruba

§

AX = 248

Åland Islands

§

AZ = 31

Azerbaijan

§

BA = 70

Bosnia and Herzegovina

§

BB = 52

Barbados

§

BD = 50

Bangladesh

§

BE = 56

Belgium

§

BF = 854

Burkina Faso

§

BG = 100

Bulgaria

§

BH = 48

Bahrain

§

BI = 108

Burundi

§

BJ = 204

Benin

§

BL = 652

Saint Barthélemy

§

BM = 60

Bermuda

§

BN = 96

Brunei Darussalam

§

BO = 68

Bolivia (Plurinational State of)

§

BQ = 535

Bonaire, Sint Eustatius and Saba

§

BR = 76

Brazil

§

BS = 44

Bahamas

§

BT = 64

Bhutan

§

BV = 74

Bouvet Island

§

BW = 72

Botswana

§

BY = 112

Belarus

§

BZ = 84

Belize

§

CA = 124

Canada

§

CC = 166

Cocos (Keeling) Islands

§

CD = 180

Congo, Democratic Republic of the

§

CF = 140

Central African Republic

§

CG = 178

Congo

§

CH = 756

Switzerland

§

CI = 384

Côte d’Ivoire

§

CK = 184

Cook Islands

§

CL = 152

Chile

§

CM = 120

Cameroon

§

CN = 156

China

§

CO = 170

Colombia

§

CR = 188

Costa Rica

§

CU = 192

Cuba

§

CV = 132

Cabo Verde

§

CW = 531

Curaçao

§

CX = 162

Christmas Island

§

CY = 196

Cyprus

§

CZ = 203

Czechia

§

DE = 276

Germany

§

DJ = 262

Djibouti

§

DK = 208

Denmark

§

DM = 212

Dominica

§

DO = 214

Dominican Republic

§

DZ = 12

Algeria

§

EC = 218

Ecuador

§

EE = 233

Estonia

§

EG = 818

Egypt

§

EH = 732

Western Sahara

§

ER = 232

Eritrea

§

ES = 724

Spain

§

ET = 231

Ethiopia

§

FI = 246

Finland

§

FJ = 242

Fiji

§

FK = 238

Falkland Islands (Malvinas)

§

FM = 583

Micronesia (Federated States of)

§

FO = 234

Faroe Islands

§

FR = 250

France

§

GA = 266

Gabon

§

GB = 826

United Kingdom of Great Britain and Northern Ireland

§

GD = 308

Grenada

§

GE = 268

Georgia

§

GF = 254

French Guiana

§

GG = 831

Guernsey

§

GH = 288

Ghana

§

GI = 292

Gibraltar

§

GL = 304

Greenland

§

GM = 270

Gambia

§

GN = 324

Guinea

§

GP = 312

Guadeloupe

§

GQ = 226

Equatorial Guinea

§

GR = 300

Greece

§

GS = 239

South Georgia and the South Sandwich Islands

§

GT = 320

Guatemala

§

GU = 316

Guam

§

GW = 624

Guinea-Bissau

§

GY = 328

Guyana

§

HK = 344

Hong Kong

§

HM = 334

Heard Island and McDonald Islands

§

HN = 340

Honduras

§

HR = 191

Croatia

§

HT = 332

Haiti

§

HU = 348

Hungary

§

ID = 360

Indonesia

§

IE = 372

Ireland

§

IL = 376

Israel

§

IM = 833

Isle of Man

§

IN = 356

India

§

IO = 86

British Indian Ocean Territory

§

IQ = 368

Iraq

§

IR = 364

Iran (Islamic Republic of)

§

IS = 352

Iceland

§

IT = 380

Italy

§

JE = 832

Jersey

§

JM = 388

Jamaica

§

JO = 400

Jordan

§

JP = 392

Japan

§

KE = 404

Kenya

§

KG = 417

Kyrgyzstan

§

KH = 116

Cambodia

§

KI = 296

Kiribati

§

KM = 174

Comoros

§

KN = 659

Saint Kitts and Nevis

§

KP = 408

Korea (Democratic People’s Republic of)

§

KR = 410

Korea, Republic of

§

KW = 414

Kuwait

§

KY = 136

Cayman Islands

§

KZ = 398

Kazakhstan

§

LA = 418

Lao People’s Democratic Republic

§

LB = 422

Lebanon

§

LC = 662

Saint Lucia

§

LI = 438

Liechtenstein

§

LK = 144

Sri Lanka

§

LR = 430

Liberia

§

LS = 426

Lesotho

§

LT = 440

Lithuania

§

LU = 442

Luxembourg

§

LV = 428

Latvia

§

LY = 434

Libya

§

MA = 504

Morocco

§

MC = 492

Monaco

§

MD = 498

Moldova, Republic of

§

ME = 499

Montenegro

§

MF = 663

Saint Martin (French part)

§

MG = 450

Madagascar

§

MH = 584

Marshall Islands

§

MK = 807

North Macedonia

§

ML = 466

Mali

§

MM = 104

Myanmar

§

MN = 496

Mongolia

§

MO = 446

Macao

§

MP = 580

Northern Mariana Islands

§

MQ = 474

Martinique

§

MR = 478

Mauritania

§

MS = 500

Montserrat

§

MT = 470

Malta

§

MU = 480

Mauritius

§

MV = 462

Maldives

§

MW = 454

Malawi

§

MX = 484

Mexico

§

MY = 458

Malaysia

§

MZ = 508

Mozambique

§

NA = 516

Namibia

§

NC = 540

New Caledonia

§

NE = 562

Niger

§

NF = 574

Norfolk Island

§

NG = 566

Nigeria

§

NI = 558

Nicaragua

§

NL = 528

Netherlands, Kingdom of the

§

NO = 578

Norway

§

NP = 524

Nepal

§

NR = 520

Nauru

§

NU = 570

Niue

§

NZ = 554

New Zealand

§

OM = 512

Oman

§

PA = 591

Panama

§

PE = 604

Peru

§

PF = 258

French Polynesia

§

PG = 598

Papua New Guinea

§

PH = 608

Philippines

§

PK = 586

Pakistan

§

PL = 616

Poland

§

PM = 666

Saint Pierre and Miquelon

§

PN = 612

Pitcairn

§

PR = 630

Puerto Rico

§

PS = 275

Palestine, State of

§

PT = 620

Portugal

§

PW = 585

Palau

§

PY = 600

Paraguay

§

QA = 634

Qatar

§

RE = 638

Réunion

§

RO = 642

Romania

§

RS = 688

Serbia

§

RU = 643

Russian Federation

§

RW = 646

Rwanda

§

SA = 682

Saudi Arabia

§

SB = 90

Solomon Islands

§

SC = 690

Seychelles

§

SD = 729

Sudan

§

SE = 752

Sweden

§

SG = 702

Singapore

§

SH = 654

Saint Helena, Ascension and Tristan da Cunha

§

SI = 705

Slovenia

§

SJ = 744

Svalbard and Jan Mayen

§

SK = 703

Slovakia

§

SL = 694

Sierra Leone

§

SM = 674

San Marino

§

SN = 686

Senegal

§

SO = 706

Somalia

§

SR = 740

Suriname

§

SS = 728

South Sudan

§

ST = 678

Sao Tome and Principe

§

SV = 222

El Salvador

§

SX = 534

Sint Maarten (Dutch part)

§

SY = 760

Syrian Arab Republic

§

SZ = 748

Eswatini

§

TC = 796

Turks and Caicos Islands

§

TD = 148

Chad

§

TF = 260

French Southern Territories

§

TG = 768

Togo

§

TH = 764

Thailand

§

TJ = 762

Tajikistan

§

TK = 772

Tokelau

§

TL = 626

Timor-Leste

§

TM = 795

Turkmenistan

§

TN = 788

Tunisia

§

TO = 776

Tonga

§

TR = 792

Türkiye

§

TT = 780

Trinidad and Tobago

§

TV = 798

Tuvalu

§

TW = 158

Taiwan, Province of China

§

TZ = 834

Tanzania, United Republic of

§

UA = 804

Ukraine

§

UG = 800

Uganda

§

UM = 581

United States Minor Outlying Islands

§

US = 840

United States of America

§

UY = 858

Uruguay

§

UZ = 860

Uzbekistan

§

VA = 336

Holy See

§

VC = 670

Saint Vincent and the Grenadines

§

VE = 862

Venezuela (Bolivarian Republic of)

§

VG = 92

Virgin Islands (British)

§

VI = 850

Virgin Islands (U.S.)

§

VN = 704

Viet Nam

§

VU = 548

Vanuatu

§

WF = 876

Wallis and Futuna

§

WS = 882

Samoa

§

YE = 887

Yemen

§

YT = 175

Mayotte

§

ZA = 710

South Africa

§

ZM = 894

Zambia

§

ZW = 716

Zimbabwe

§

ABW = 1_533

Aruba

§

AFG = 1_004

Afghanistan

§

AGO = 1_024

Angola

§

AIA = 1_660

Anguilla

§

ALA = 1_248

Åland Islands

§

ALB = 1_008

Albania

§

AND = 1_020

Andorra

§

ARE = 1_784

United Arab Emirates

§

ARG = 1_032

Argentina

§

ARM = 1_051

Armenia

§

ASM = 1_016

American Samoa

§

ATA = 1_010

Antarctica

§

ATF = 1_260

French Southern Territories

§

ATG = 1_028

Antigua and Barbuda

§

AUS = 1_036

Australia

§

AUT = 1_040

Austria

§

AZE = 1_031

Azerbaijan

§

BDI = 1_108

Burundi

§

BEL = 1_056

Belgium

§

BEN = 1_204

Benin

§

BES = 1_535

Bonaire, Sint Eustatius and Saba

§

BFA = 1_854

Burkina Faso

§

BGD = 1_050

Bangladesh

§

BGR = 1_100

Bulgaria

§

BHR = 1_048

Bahrain

§

BHS = 1_044

Bahamas

§

BIH = 1_070

Bosnia and Herzegovina

§

BLM = 1_652

Saint Barthélemy

§

BLR = 1_112

Belarus

§

BLZ = 1_084

Belize

§

BMU = 1_060

Bermuda

§

BOL = 1_068

Bolivia (Plurinational State of)

§

BRA = 1_076

Brazil

§

BRB = 1_052

Barbados

§

BRN = 1_096

Brunei Darussalam

§

BTN = 1_064

Bhutan

§

BVT = 1_074

Bouvet Island

§

BWA = 1_072

Botswana

§

CAF = 1_140

Central African Republic

§

CAN = 1_124

Canada

§

CCK = 1_166

Cocos (Keeling) Islands

§

CHE = 1_756

Switzerland

§

CHL = 1_152

Chile

§

CHN = 1_156

China

§

CIV = 1_384

Côte d’Ivoire

§

CMR = 1_120

Cameroon

§

COD = 1_180

Congo, Democratic Republic of the

§

COG = 1_178

Congo

§

COK = 1_184

Cook Islands

§

COL = 1_170

Colombia

§

COM = 1_174

Comoros

§

CPV = 1_132

Cabo Verde

§

CRI = 1_188

Costa Rica

§

CUB = 1_192

Cuba

§

CUW = 1_531

Curaçao

§

CXR = 1_162

Christmas Island

§

CYM = 1_136

Cayman Islands

§

CYP = 1_196

Cyprus

§

CZE = 1_203

Czechia

§

DEU = 1_276

Germany

§

DJI = 1_262

Djibouti

§

DMA = 1_212

Dominica

§

DNK = 1_208

Denmark

§

DOM = 1_214

Dominican Republic

§

DZA = 1_012

Algeria

§

ECU = 1_218

Ecuador

§

EGY = 1_818

Egypt

§

ERI = 1_232

Eritrea

§

ESH = 1_732

Western Sahara

§

ESP = 1_724

Spain

§

EST = 1_233

Estonia

§

ETH = 1_231

Ethiopia

§

FIN = 1_246

Finland

§

FJI = 1_242

Fiji

§

FLK = 1_238

Falkland Islands (Malvinas)

§

FRA = 1_250

France

§

FRO = 1_234

Faroe Islands

§

FSM = 1_583

Micronesia (Federated States of)

§

GAB = 1_266

Gabon

§

GBR = 1_826

United Kingdom of Great Britain and Northern Ireland

§

GEO = 1_268

Georgia

§

GGY = 1_831

Guernsey

§

GHA = 1_288

Ghana

§

GIB = 1_292

Gibraltar

§

GIN = 1_324

Guinea

§

GLP = 1_312

Guadeloupe

§

GMB = 1_270

Gambia

§

GNB = 1_624

Guinea-Bissau

§

GNQ = 1_226

Equatorial Guinea

§

GRC = 1_300

Greece

§

GRD = 1_308

Grenada

§

GRL = 1_304

Greenland

§

GTM = 1_320

Guatemala

§

GUF = 1_254

French Guiana

§

GUM = 1_316

Guam

§

GUY = 1_328

Guyana

§

HKG = 1_344

Hong Kong

§

HMD = 1_334

Heard Island and McDonald Islands

§

HND = 1_340

Honduras

§

HRV = 1_191

Croatia

§

HTI = 1_332

Haiti

§

HUN = 1_348

Hungary

§

IDN = 1_360

Indonesia

§

IMN = 1_833

Isle of Man

§

IND = 1_356

India

§

IOT = 1_086

British Indian Ocean Territory

§

IRL = 1_372

Ireland

§

IRN = 1_364

Iran (Islamic Republic of)

§

IRQ = 1_368

Iraq

§

ISL = 1_352

Iceland

§

ISR = 1_376

Israel

§

ITA = 1_380

Italy

§

JAM = 1_388

Jamaica

§

JEY = 1_832

Jersey

§

JOR = 1_400

Jordan

§

JPN = 1_392

Japan

§

KAZ = 1_398

Kazakhstan

§

KEN = 1_404

Kenya

§

KGZ = 1_417

Kyrgyzstan

§

KHM = 1_116

Cambodia

§

KIR = 1_296

Kiribati

§

KNA = 1_659

Saint Kitts and Nevis

§

KOR = 1_410

Korea, Republic of

§

KWT = 1_414

Kuwait

§

LAO = 1_418

Lao People’s Democratic Republic

§

LBN = 1_422

Lebanon

§

LBR = 1_430

Liberia

§

LBY = 1_434

Libya

§

LCA = 1_662

Saint Lucia

§

LIE = 1_438

Liechtenstein

§

LKA = 1_144

Sri Lanka

§

LSO = 1_426

Lesotho

§

LTU = 1_440

Lithuania

§

LUX = 1_442

Luxembourg

§

LVA = 1_428

Latvia

§

MAC = 1_446

Macao

§

MAF = 1_663

Saint Martin (French part)

§

MAR = 1_504

Morocco

§

MCO = 1_492

Monaco

§

MDA = 1_498

Moldova, Republic of

§

MDG = 1_450

Madagascar

§

MDV = 1_462

Maldives

§

MEX = 1_484

Mexico

§

MHL = 1_584

Marshall Islands

§

MKD = 1_807

North Macedonia

§

MLI = 1_466

Mali

§

MLT = 1_470

Malta

§

MMR = 1_104

Myanmar

§

MNE = 1_499

Montenegro

§

MNG = 1_496

Mongolia

§

MNP = 1_580

Northern Mariana Islands

§

MOZ = 1_508

Mozambique

§

MRT = 1_478

Mauritania

§

MSR = 1_500

Montserrat

§

MTQ = 1_474

Martinique

§

MUS = 1_480

Mauritius

§

MWI = 1_454

Malawi

§

MYS = 1_458

Malaysia

§

MYT = 1_175

Mayotte

§

NAM = 1_516

Namibia

§

NCL = 1_540

New Caledonia

§

NER = 1_562

Niger

§

NFK = 1_574

Norfolk Island

§

NGA = 1_566

Nigeria

§

NIC = 1_558

Nicaragua

§

NIU = 1_570

Niue

§

NLD = 1_528

Netherlands, Kingdom of the

§

NOR = 1_578

Norway

§

NPL = 1_524

Nepal

§

NRU = 1_520

Nauru

§

NZL = 1_554

New Zealand

§

OMN = 1_512

Oman

§

PAK = 1_586

Pakistan

§

PAN = 1_591

Panama

§

PCN = 1_612

Pitcairn

§

PER = 1_604

Peru

§

PHL = 1_608

Philippines

§

PLW = 1_585

Palau

§

PNG = 1_598

Papua New Guinea

§

POL = 1_616

Poland

§

PRI = 1_630

Puerto Rico

§

PRK = 1_408

Korea (Democratic People’s Republic of)

§

PRT = 1_620

Portugal

§

PRY = 1_600

Paraguay

§

PSE = 1_275

Palestine, State of

§

PYF = 1_258

French Polynesia

§

QAT = 1_634

Qatar

§

REU = 1_638

Réunion

§

ROU = 1_642

Romania

§

RUS = 1_643

Russian Federation

§

RWA = 1_646

Rwanda

§

SAU = 1_682

Saudi Arabia

§

SDN = 1_729

Sudan

§

SEN = 1_686

Senegal

§

SGP = 1_702

Singapore

§

SGS = 1_239

South Georgia and the South Sandwich Islands

§

SHN = 1_654

Saint Helena, Ascension and Tristan da Cunha

§

SJM = 1_744

Svalbard and Jan Mayen

§

SLB = 1_090

Solomon Islands

§

SLE = 1_694

Sierra Leone

§

SLV = 1_222

El Salvador

§

SMR = 1_674

San Marino

§

SOM = 1_706

Somalia

§

SPM = 1_666

Saint Pierre and Miquelon

§

SRB = 1_688

Serbia

§

SSD = 1_728

South Sudan

§

STP = 1_678

Sao Tome and Principe

§

SUR = 1_740

Suriname

§

SVK = 1_703

Slovakia

§

SVN = 1_705

Slovenia

§

SWE = 1_752

Sweden

§

SWZ = 1_748

Eswatini

§

SXM = 1_534

Sint Maarten (Dutch part)

§

SYC = 1_690

Seychelles

§

SYR = 1_760

Syrian Arab Republic

§

TCA = 1_796

Turks and Caicos Islands

§

TCD = 1_148

Chad

§

TGO = 1_768

Togo

§

THA = 1_764

Thailand

§

TJK = 1_762

Tajikistan

§

TKL = 1_772

Tokelau

§

TKM = 1_795

Turkmenistan

§

TLS = 1_626

Timor-Leste

§

TON = 1_776

Tonga

§

TTO = 1_780

Trinidad and Tobago

§

TUN = 1_788

Tunisia

§

TUR = 1_792

Türkiye

§

TUV = 1_798

Tuvalu

§

TWN = 1_158

Taiwan, Province of China

§

TZA = 1_834

Tanzania, United Republic of

§

UGA = 1_800

Uganda

§

UKR = 1_804

Ukraine

§

UMI = 1_581

United States Minor Outlying Islands

§

URY = 1_858

Uruguay

§

USA = 1_840

United States of America

§

UZB = 1_860

Uzbekistan

§

VAT = 1_336

Holy See

§

VCT = 1_670

Saint Vincent and the Grenadines

§

VEN = 1_862

Venezuela (Bolivarian Republic of)

§

VGB = 1_092

Virgin Islands (British)

§

VIR = 1_850

Virgin Islands (U.S.)

§

VNM = 1_704

Viet Nam

§

VUT = 1_548

Vanuatu

§

WLF = 1_876

Wallis and Futuna

§

WSM = 1_882

Samoa

§

YEM = 1_887

Yemen

§

ZAF = 1_710

South Africa

§

ZMB = 1_894

Zambia

§

ZWE = 1_716

Zimbabwe

Implementations§

Source§

impl CountryCode

Source

pub fn all() -> Vec<Self>

Returns all the country codes.

Source

pub const fn country(&self) -> Country

Returns the Country variant corresponding to the CountryCode.

This method provides an easy way to get to the associated Country variant from a CountryCode enum variant.

Source

pub const fn is_alpha2(&self) -> bool

Returns true if the CountryCode is a two-letter code.

This method provides an easy way to check if a CountryCode is a two-letter code (ISO 3166-1 alpha-2).

Source

pub const fn is_alpha3(&self) -> bool

Returns true if the CountryCode is a three-letter code.

This method provides an easy way to check if a CountryCode is a three-letter code (ISO 3166-1 alpha-3).

Source

pub fn to_alpha2(&self) -> Self

Converts a three-letter CountryCode to a two-letter CountryCode.

This method provides an easy way to convert a CountryCode from a three-letter code (ISO 3166-1 alpha-3) to a two-letter code (ISO 3166-1 alpha-2).

Source

pub const fn to_alpha3(&self) -> Self

Converts a two-letter CountryCode to a three-letter CountryCode.

This method provides an easy way to convert a CountryCode from a two-letter code (ISO 3166-1 alpha-2) to a three-letter code (ISO 3166-1 alpha-3).

Trait Implementations§

Source§

impl AsStr for CountryCode

Source§

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

Provides a string slice representation of the type.
Source§

impl Clone for CountryCode

Source§

fn clone(&self) -> CountryCode

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 CountryCode

Source§

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

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

impl<'de> Deserialize<'de> for CountryCode

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 CountryCode

Source§

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

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

impl From<CountryCode> for String

Source§

fn from(code: CountryCode) -> Self

Converts to this type from the input type.
Source§

impl From<CountryCode> for u16

Source§

fn from(code: CountryCode) -> Self

Converts to this type from the input type.
Source§

impl FromStr for CountryCode

Source§

type Err = String

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 CountryCode

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 CountryCode

Source§

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

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<String> for CountryCode

Source§

type Error = String

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

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

Performs the conversion.
Source§

impl TryFrom<u16> for CountryCode

Source§

type Error = String

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

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

Performs the conversion.
Source§

impl Copy for CountryCode

Source§

impl Eq for CountryCode

Source§

impl StructuralPartialEq for CountryCode

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

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