Crate codes_un_m49

Source
Expand description

This package contains an implementation of the UN M49 Standard Country or Area Codes for Statistical Use (Series M, No. 49) specification.

UN M49 or the Standard Country or Area Codes for Statistical Use (Series M, No. 49) is a standard for area codes used by the United Nations for statistical purposes, developed and maintained by the United Nations Statistics Division. Each area code is a 3-digit number which can refer to a wide variety of geographical and political regions, like a continent and a country. Codes assigned in the system generally do not change when the country or area’s name changes (unlike ISO 3166-1 alpha-2 or ISO 3166-1 alpha-3), but instead change when the territorial extent of the country or area changes significantly, although there have been exceptions to this rule.

§Example

use codes_un_m49 as M49;

let region = M49::UN_M69_REGION_258;

assert_eq!(region.code(), 258);
assert_eq!(region.name(), "French Polynesia");
assert_eq!(region.kind(), M49::RegionKind::Country);

// feature = "country_codes"
// assert_eq!(parent.country_code(), Some(CountryCode::PF));
// or
// assert_eq!(region.country_code(), Some("PF"));

let parent = region.parent_code().unwrap();
assert_eq!(parent.code(), 61);
assert_eq!(parent.name(), "Polynesia");

let parent = parent.parent_code().unwrap();
assert_eq!(parent.code(), 9);
assert_eq!(parent.name(), "Oceania");

let parent = parent.parent_code().unwrap();
assert_eq!(parent.code(), 1);
assert_eq!(parent.name(), "World");

§Features

By default only the serde feature is enabled.

Structs§

RegionClassificationCode
This structure encapsulates the integer code for regions defined in the UN M49 standard.

Enums§

RegionClassificationCodeError
Common Error type, mainly used for FromStr failures.
RegionKind
This enumeration is derived from the column headings in the M49 downloadable CSV file.

Constants§

ALL_CODES
Provides an array of all defined RegionClassificationCode codes, useful for queries.
UN_M49
An instance of the Standard struct defined in the codes_agency package that describes the UN M49 specification.
UN_M69_REGION_001
World
UN_M69_REGION_002
Africa
UN_M69_REGION_004
Afghanistan
UN_M69_REGION_005
South America
UN_M69_REGION_008
Albania
UN_M69_REGION_009
Oceania
UN_M69_REGION_010
Antarctica
UN_M69_REGION_011
Western Africa
UN_M69_REGION_012
Algeria
UN_M69_REGION_013
Central America
UN_M69_REGION_014
Eastern Africa
UN_M69_REGION_015
Northern Africa
UN_M69_REGION_016
American Samoa
UN_M69_REGION_017
Middle Africa
UN_M69_REGION_018
Southern Africa
UN_M69_REGION_019
Americas
UN_M69_REGION_020
Andorra
UN_M69_REGION_021
Northern America
UN_M69_REGION_024
Angola
UN_M69_REGION_028
Antigua and Barbuda
UN_M69_REGION_029
Caribbean
UN_M69_REGION_030
Eastern Asia
UN_M69_REGION_031
Azerbaijan
UN_M69_REGION_032
Argentina
UN_M69_REGION_034
Southern Asia
UN_M69_REGION_035
South-eastern Asia
UN_M69_REGION_036
Australia
UN_M69_REGION_039
Southern Europe
UN_M69_REGION_040
Austria
UN_M69_REGION_044
Bahamas
UN_M69_REGION_048
Bahrain
UN_M69_REGION_050
Bangladesh
UN_M69_REGION_051
Armenia
UN_M69_REGION_052
Barbados
UN_M69_REGION_053
Australia and New Zealand
UN_M69_REGION_054
Melanesia
UN_M69_REGION_056
Belgium
UN_M69_REGION_057
Micronesia
UN_M69_REGION_060
Bermuda
UN_M69_REGION_061
Polynesia
UN_M69_REGION_064
Bhutan
UN_M69_REGION_068
Bolivia (Plurinational State of)
UN_M69_REGION_070
Bosnia and Herzegovina
UN_M69_REGION_072
Botswana
UN_M69_REGION_074
Bouvet Island
UN_M69_REGION_076
Brazil
UN_M69_REGION_084
Belize
UN_M69_REGION_086
British Indian Ocean Territory
UN_M69_REGION_090
Solomon Islands
UN_M69_REGION_092
British Virgin Islands
UN_M69_REGION_096
Brunei Darussalam
UN_M69_REGION_100
Bulgaria
UN_M69_REGION_104
Myanmar
UN_M69_REGION_108
Burundi
UN_M69_REGION_112
Belarus
UN_M69_REGION_116
Cambodia
UN_M69_REGION_120
Cameroon
UN_M69_REGION_124
Canada
UN_M69_REGION_132
Cabo Verde
UN_M69_REGION_136
Cayman Islands
UN_M69_REGION_140
Central African Republic
UN_M69_REGION_142
Asia
UN_M69_REGION_143
Central Asia
UN_M69_REGION_144
Sri Lanka
UN_M69_REGION_145
Western Asia
UN_M69_REGION_148
Chad
UN_M69_REGION_150
Europe
UN_M69_REGION_151
Eastern Europe
UN_M69_REGION_152
Chile
UN_M69_REGION_154
Northern Europe
UN_M69_REGION_155
Western Europe
UN_M69_REGION_156
China
UN_M69_REGION_162
Christmas Island
UN_M69_REGION_166
Cocos (Keeling) Islands
UN_M69_REGION_170
Colombia
UN_M69_REGION_174
Comoros
UN_M69_REGION_175
Mayotte
UN_M69_REGION_178
Congo
UN_M69_REGION_180
Democratic Republic of the Congo
UN_M69_REGION_184
Cook Islands
UN_M69_REGION_188
Costa Rica
UN_M69_REGION_191
Croatia
UN_M69_REGION_192
Cuba
UN_M69_REGION_196
Cyprus
UN_M69_REGION_202
Sub-Saharan Africa
UN_M69_REGION_203
Czechia
UN_M69_REGION_204
Benin
UN_M69_REGION_208
Denmark
UN_M69_REGION_212
Dominica
UN_M69_REGION_214
Dominican Republic
UN_M69_REGION_218
Ecuador
UN_M69_REGION_222
El Salvador
UN_M69_REGION_226
Equatorial Guinea
UN_M69_REGION_231
Ethiopia
UN_M69_REGION_232
Eritrea
UN_M69_REGION_233
Estonia
UN_M69_REGION_234
Faroe Islands
UN_M69_REGION_238
Falkland Islands (Malvinas)
UN_M69_REGION_239
South Georgia and the South Sandwich Islands
UN_M69_REGION_242
Fiji
UN_M69_REGION_246
Finland
UN_M69_REGION_248
Åland Islands
UN_M69_REGION_250
France
UN_M69_REGION_254
French Guiana
UN_M69_REGION_258
French Polynesia
UN_M69_REGION_260
French Southern Territories
UN_M69_REGION_262
Djibouti
UN_M69_REGION_266
Gabon
UN_M69_REGION_268
Georgia
UN_M69_REGION_270
Gambia
UN_M69_REGION_275
State of Palestine
UN_M69_REGION_276
Germany
UN_M69_REGION_288
Ghana
UN_M69_REGION_292
Gibraltar
UN_M69_REGION_296
Kiribati
UN_M69_REGION_300
Greece
UN_M69_REGION_304
Greenland
UN_M69_REGION_308
Grenada
UN_M69_REGION_312
Guadeloupe
UN_M69_REGION_316
Guam
UN_M69_REGION_320
Guatemala
UN_M69_REGION_324
Guinea
UN_M69_REGION_328
Guyana
UN_M69_REGION_332
Haiti
UN_M69_REGION_334
Heard Island and McDonald Islands
UN_M69_REGION_336
Holy See
UN_M69_REGION_340
Honduras
UN_M69_REGION_344
China, Hong Kong Special Administrative Region
UN_M69_REGION_348
Hungary
UN_M69_REGION_352
Iceland
UN_M69_REGION_356
India
UN_M69_REGION_360
Indonesia
UN_M69_REGION_364
Iran (Islamic Republic of)
UN_M69_REGION_368
Iraq
UN_M69_REGION_372
Ireland
UN_M69_REGION_376
Israel
UN_M69_REGION_380
Italy
UN_M69_REGION_384
Côte d’Ivoire
UN_M69_REGION_388
Jamaica
UN_M69_REGION_392
Japan
UN_M69_REGION_398
Kazakhstan
UN_M69_REGION_400
Jordan
UN_M69_REGION_404
Kenya
UN_M69_REGION_408
Democratic People’s Republic of Korea
UN_M69_REGION_410
Republic of Korea
UN_M69_REGION_414
Kuwait
UN_M69_REGION_417
Kyrgyzstan
UN_M69_REGION_418
Lao People’s Democratic Republic
UN_M69_REGION_419
Latin America and the Caribbean
UN_M69_REGION_422
Lebanon
UN_M69_REGION_426
Lesotho
UN_M69_REGION_428
Latvia
UN_M69_REGION_430
Liberia
UN_M69_REGION_434
Libya
UN_M69_REGION_438
Liechtenstein
UN_M69_REGION_440
Lithuania
UN_M69_REGION_442
Luxembourg
UN_M69_REGION_446
China, Macao Special Administrative Region
UN_M69_REGION_450
Madagascar
UN_M69_REGION_454
Malawi
UN_M69_REGION_458
Malaysia
UN_M69_REGION_462
Maldives
UN_M69_REGION_466
Mali
UN_M69_REGION_470
Malta
UN_M69_REGION_474
Martinique
UN_M69_REGION_478
Mauritania
UN_M69_REGION_480
Mauritius
UN_M69_REGION_484
Mexico
UN_M69_REGION_492
Monaco
UN_M69_REGION_496
Mongolia
UN_M69_REGION_498
Republic of Moldova
UN_M69_REGION_499
Montenegro
UN_M69_REGION_500
Montserrat
UN_M69_REGION_504
Morocco
UN_M69_REGION_508
Mozambique
UN_M69_REGION_512
Oman
UN_M69_REGION_516
Namibia
UN_M69_REGION_520
Nauru
UN_M69_REGION_524
Nepal
UN_M69_REGION_528
Netherlands
UN_M69_REGION_531
Curaçao
UN_M69_REGION_533
Aruba
UN_M69_REGION_534
Sint Maarten (Dutch part)
UN_M69_REGION_535
Bonaire, Sint Eustatius and Saba
UN_M69_REGION_540
New Caledonia
UN_M69_REGION_548
Vanuatu
UN_M69_REGION_554
New Zealand
UN_M69_REGION_558
Nicaragua
UN_M69_REGION_562
Niger
UN_M69_REGION_566
Nigeria
UN_M69_REGION_570
Niue
UN_M69_REGION_574
Norfolk Island
UN_M69_REGION_578
Norway
UN_M69_REGION_580
Northern Mariana Islands
UN_M69_REGION_581
United States Minor Outlying Islands
UN_M69_REGION_583
Micronesia (Federated States of)
UN_M69_REGION_584
Marshall Islands
UN_M69_REGION_585
Palau
UN_M69_REGION_586
Pakistan
UN_M69_REGION_591
Panama
UN_M69_REGION_598
Papua New Guinea
UN_M69_REGION_600
Paraguay
UN_M69_REGION_604
Peru
UN_M69_REGION_608
Philippines
UN_M69_REGION_612
Pitcairn
UN_M69_REGION_616
Poland
UN_M69_REGION_620
Portugal
UN_M69_REGION_624
Guinea-Bissau
UN_M69_REGION_626
Timor-Leste
UN_M69_REGION_630
Puerto Rico
UN_M69_REGION_634
Qatar
UN_M69_REGION_638
Réunion
UN_M69_REGION_642
Romania
UN_M69_REGION_643
Russian Federation
UN_M69_REGION_646
Rwanda
UN_M69_REGION_652
Saint Barthélemy
UN_M69_REGION_654
Saint Helena
UN_M69_REGION_659
Saint Kitts and Nevis
UN_M69_REGION_660
Anguilla
UN_M69_REGION_662
Saint Lucia
UN_M69_REGION_663
Saint Martin (French Part)
UN_M69_REGION_666
Saint Pierre and Miquelon
UN_M69_REGION_670
Saint Vincent and the Grenadines
UN_M69_REGION_674
San Marino
UN_M69_REGION_678
Sao Tome and Principe
UN_M69_REGION_680
Sark
UN_M69_REGION_682
Saudi Arabia
UN_M69_REGION_686
Senegal
UN_M69_REGION_688
Serbia
UN_M69_REGION_690
Seychelles
UN_M69_REGION_694
Sierra Leone
UN_M69_REGION_702
Singapore
UN_M69_REGION_703
Slovakia
UN_M69_REGION_704
Viet Nam
UN_M69_REGION_705
Slovenia
UN_M69_REGION_706
Somalia
UN_M69_REGION_710
South Africa
UN_M69_REGION_716
Zimbabwe
UN_M69_REGION_724
Spain
UN_M69_REGION_728
South Sudan
UN_M69_REGION_729
Sudan
UN_M69_REGION_732
Western Sahara
UN_M69_REGION_740
Suriname
UN_M69_REGION_744
Svalbard and Jan Mayen Islands
UN_M69_REGION_748
Eswatini
UN_M69_REGION_752
Sweden
UN_M69_REGION_756
Switzerland
UN_M69_REGION_760
Syrian Arab Republic
UN_M69_REGION_762
Tajikistan
UN_M69_REGION_764
Thailand
UN_M69_REGION_768
Togo
UN_M69_REGION_772
Tokelau
UN_M69_REGION_776
Tonga
UN_M69_REGION_780
Trinidad and Tobago
UN_M69_REGION_784
United Arab Emirates
UN_M69_REGION_788
Tunisia
UN_M69_REGION_792
Türkiye
UN_M69_REGION_795
Turkmenistan
UN_M69_REGION_796
Turks and Caicos Islands
UN_M69_REGION_798
Tuvalu
UN_M69_REGION_800
Uganda
UN_M69_REGION_804
Ukraine
UN_M69_REGION_807
North Macedonia
UN_M69_REGION_818
Egypt
UN_M69_REGION_826
United Kingdom of Great Britain and Northern Ireland
UN_M69_REGION_830
Channel Islands
UN_M69_REGION_831
Guernsey
UN_M69_REGION_832
Jersey
UN_M69_REGION_833
Isle of Man
UN_M69_REGION_834
United Republic of Tanzania
UN_M69_REGION_840
United States of America
UN_M69_REGION_850
United States Virgin Islands
UN_M69_REGION_854
Burkina Faso
UN_M69_REGION_858
Uruguay
UN_M69_REGION_860
Uzbekistan
UN_M69_REGION_862
Venezuela (Bolivarian Republic of)
UN_M69_REGION_876
Wallis and Futuna Islands
UN_M69_REGION_882
Samoa
UN_M69_REGION_887
Yemen
UN_M69_REGION_894
Zambia