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.
serde
- Enables serialization of the RegionClassificationCode type.country_codes
; if enabled the value returned by the RegionClassificationCode::country_code method will be an instance ofCountryCode
from thecodes-iso-3166
package, otherwise it returns'static str
.
Structs§
- Region
Classification Code - This structure encapsulates the integer code for regions defined in the UN M49 standard.
Enums§
- Region
Classification Code Error - Common
Error
type, mainly used forFromStr
failures. - Region
Kind - 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 thecodes_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