Enum keshvar::WorldRegion
source · pub enum WorldRegion {
AMER,
APAC,
EMEA,
}Expand description
An enum containing all four world regions.
§Example
use keshvar::{WorldRegion, Alpha2};
let world_region = WorldRegion::try_from("AMER").unwrap();
let country_list: Vec<_> = world_region
.alpha2_list()
.iter()
.map(|alpha2_str| Alpha2::try_from(*alpha2_str).unwrap())
.collect();
assert!(country_list.contains(&Alpha2::JM)); // JamaicaWe usually need to convert Alpha2 to Country and use that object instead.
Variants§
AMER
- Antigua and Barbuda (Americas)
- Anguilla (Americas)
- Antarctica
- The Argentine Republic (Americas)
- Aruba (Americas)
- Barbados (Americas)
- Bermuda (Americas)
- The Plurinational State of Bolivia (Americas)
- The Federative Republic of Brazil (Americas)
- The Commonwealth of The Bahamas (Americas)
- Belize (Americas)
- Canada (Americas)
- The Republic of Chile (Americas)
- The Republic of Colombia (Americas)
- The Republic of Costa Rica (Americas)
- The Republic of Cuba (Americas)
- The Country of Curaçao (Americas)
- The Commonwealth of Dominica (Americas)
- The Dominican Republic (Americas)
- The Republic of Ecuador (Americas)
- The Falkland Islands (Americas)
- Grenada (Americas)
- Guyane (Americas)
- Guadeloupe (Americas)
- South Georgia and the South Sandwich Islands (Americas)
- The Republic of Guatemala (Americas)
- The Co-operative Republic of Guyana (Americas)
- The Republic of Honduras (Americas)
- The Republic of Haiti (Americas)
- Jamaica (Americas)
- Saint Kitts and Nevis (Americas)
- The Cayman Islands (Americas)
- Saint Lucia (Americas)
- The Collectivity of Saint-Martin (Americas)
- Martinique (Americas)
- The United Mexican States (Americas)
- The Republic of Nicaragua (Americas)
- The Republic of Panamá (Americas)
- The Republic of Perú (Americas)
- The Overseas Collectivity of Saint-Pierre and Miquelon (Americas)
- The Commonwealth of Puerto Rico (Americas)
- The Republic of Paraguay (Americas)
- The Republic of Suriname (Americas)
- The Republic of El Salvador (Americas)
- Sint Maarten (Americas)
- The Republic of Trinidad and Tobago (Americas)
- United States Minor Outlying Islands (Americas)
- The United States of America (Americas)
- The Oriental Republic of Uruguay (Americas)
- Saint Vincent and the Grenadines (Americas)
- The Bolivarian Republic of Venezuela (Americas)
- The Virgin Islands (Americas)
- The Virgin Islands of the United States (Americas)
APAC
- The Islamic Republic of Afghanistan (Asia)
- The Territory of American Samoa (Oceania)
- The Commonwealth of Australia (Oceania)
- The People’s Republic of Bangladesh (Asia)
- The Collectivity of Saint-Barthélemy (Americas)
- The Nation of Brunei, the Abode of Peace (Asia)
- Bonaire, Sint Eustatius and Saba (Americas)
- The Kingdom of Bhutan (Asia)
- Bouvet Island
- The Territory of Cocos (Keeling) Islands (Oceania)
- The Cook Islands (Oceania)
- The People’s Republic of China (Asia)
- The Territory of Christmas Island (Oceania)
- The Republic of Fiji (Oceania)
- The Federated States of Micronesia (Oceania)
- The Territory of Guam (Oceania)
- The Hong Kong Special Administrative Region of China (Asia)
- The Territory of Heard Island and McDonald Islands
- The Republic of Indonesia (Asia)
- The Republic of India (Asia)
- The British Indian Ocean Territory (Africa)
- Japan (Asia)
- The Kingdom of Cambodia (Asia)
- The Republic of Kiribati (Oceania)
- The Democratic People’s Republic of Korea (Asia)
- The Republic of Korea (Asia)
- The Lao People’s Democratic Republic (Asia)
- The Democratic Socialist Republic of Sri Lanka (Asia)
- The Republic of the Marshall Islands (Oceania)
- The Republic of the Union of Myanmar (Asia)
- Mongolia (Asia)
- The Macao Special Administrative Region of China (Asia)
- The Commonwealth of the Northern Mariana Islands (Oceania)
- The Republic of Maldives (Asia)
- Malaysia (Asia)
- New Caledonia (Oceania)
- The Territory of Norfolk Island (Oceania)
- The Federal Democratic Republic of Nepal (Asia)
- The Republic of Nauru (Oceania)
- Niue (Oceania)
- New Zealand (Oceania)
- French Polynesia (Oceania)
- The Independent State of Papua New Guinea (Oceania)
- The Republic of the Philippines (Asia)
- The Islamic Republic of Pakistan (Asia)
- The Pitcairn, Henderson, Ducie and Oeno Islands (Oceania)
- The Republic of Palau (Oceania)
- The Solomon Islands (Oceania)
- The Republic of Singapore (Asia)
- Saint Helena, Ascension and Tristan da Cunha (Africa)
- The Turks and Caicos Islands (Americas)
- The Kingdom of Thailand (Asia)
- Tokelau (Oceania)
- The Democratic Republic of Timor-Leste (Asia)
- The Kingdom of Tonga (Oceania)
- Tuvalu (Oceania)
- Taiwan, Province of China (Asia)
- The Socialist Republic of Viet Nam (Asia)
- The Republic of Vanuatu (Oceania)
- The Territory of the Wallis and Futuna Islands (Oceania)
- The Independent State of Samoa (Oceania)
EMEA
- The Principality of Andorra (Europe)
- The United Arab Emirates (Asia)
- The Republic of Albania (Europe)
- The Republic of Armenia (Asia)
- The Republic of Angola (Africa)
- The Republic of Austria (Europe)
- Åland (Europe)
- The Republic of Azerbaijan (Asia)
- Bosnia and Herzegovina (Europe)
- The Kingdom of Belgium (Europe)
- Burkina Faso (Africa)
- The Republic of Bulgaria (Europe)
- The Kingdom of Bahrain (Asia)
- The Republic of Burundi (Africa)
- The Republic of Benin (Africa)
- The Republic of Botswana (Africa)
- The Republic of Belarus (Europe)
- The Democratic Republic of the Congo (Africa)
- The Central African Republic (Africa)
- The Republic of the Congo (Africa)
- The Swiss Confederation (Europe)
- The Republic of Côte d’Ivoire (Africa)
- The Republic of Cameroon (Africa)
- The Republic of Cabo Verde (Africa)
- The Republic of Cyprus (Asia)
- The Czech Republic (Europe)
- The Federal Republic of Germany (Europe)
- The Republic of Djibouti (Africa)
- The Kingdom of Denmark (Europe)
- The People’s Democratic Republic of Algeria (Africa)
- The Republic of Estonia (Europe)
- The Arab Republic of Egypt (Africa)
- The Sahrawi Arab Democratic Republic (Africa)
- The State of Eritrea (Africa)
- The Kingdom of Spain (Europe)
- The Federal Democratic Republic of Ethiopia (Africa)
- The Republic of Finland (Europe)
- The Faroe Islands (Europe)
- The French Republic (Europe)
- The Gabonese Republic (Africa)
- The United Kingdom of Great Britain and Northern Ireland (Europe)
- Georgia (Asia)
- The Bailiwick of Guernsey (Europe)
- The Republic of Ghana (Africa)
- Gibraltar (Europe)
- Kalaallit Nunaat (Americas)
- The Republic of The Gambia (Africa)
- The Republic of Guinea (Africa)
- The Republic of Equatorial Guinea (Africa)
- The Hellenic Republic (Europe)
- The Republic of Guinea-Bissau (Africa)
- The Republic of Croatia (Europe)
- Hungary (Europe)
- Ireland (Europe)
- The State of Israel (Asia)
- The Isle of Man (Europe)
- The Republic of Iraq (Asia)
- The Islamic Republic of Iran (Asia)
- Iceland (Europe)
- The Italian Republic (Europe)
- The Bailiwick of Jersey (Europe)
- The Hashemite Kingdom of Jordan (Asia)
- The Republic of Kenya (Africa)
- The Kyrgyz Republic (Asia)
- The Union of the Comoros (Africa)
- The State of Kuwait (Asia)
- The Republic of Kazakhstan (Asia)
- The Lebanese Republic (Asia)
- The Principality of Liechtenstein (Europe)
- The Republic of Liberia (Africa)
- The Kingdom of Lesotho (Africa)
- The Republic of Lithuania (Europe)
- The Grand Duchy of Luxembourg (Europe)
- The Republic of Latvia (Europe)
- The State of Libya (Africa)
- The Kingdom of Morocco (Africa)
- The Principality of Monaco (Europe)
- The Republic of Moldova (Europe)
- Montenegro (Europe)
- The Republic of Madagascar (Africa)
- The Republic of North Macedonia (Europe)
- The Republic of Mali (Africa)
- The Islamic Republic of Mauritania (Africa)
- Montserrat (Americas)
- The Republic of Malta (Europe)
- The Republic of Mauritius (Africa)
- The Republic of Malawi (Africa)
- The Republic of Mozambique (Africa)
- The Republic of Namibia (Africa)
- The Republic of the Niger (Africa)
- The Federal Republic of Nigeria (Africa)
- The Kingdom of the Netherlands (Europe)
- The Kingdom of Norway (Europe)
- The Sultanate of Oman (Asia)
- The Republic of Poland (Europe)
- The State of Palestine (Asia)
- The Portuguese Republic (Europe)
- The State of Qatar (Asia)
- Réunion (Africa)
- Romania (Europe)
- The Republic of Serbia (Europe)
- The Russian Federation (Europe)
- The Republic of Rwanda (Africa)
- The Kingdom of Saudi Arabia (Asia)
- The Republic of Seychelles (Africa)
- The Republic of the Sudan (Africa)
- The Kingdom of Sweden (Europe)
- The Republic of Slovenia (Europe)
- Svalbard and Jan Mayen (Europe)
- The Slovak Republic (Europe)
- The Republic of Sierra Leone (Africa)
- The Republic of San Marino (Europe)
- The Republic of Senegal (Africa)
- The Federal Republic of Somalia (Africa)
- The Republic of South Sudan (Africa)
- The Democratic Republic of São Tomé and Príncipe (Africa)
- The Syrian Arab Republic (Asia)
- The Kingdom of Eswatini (Africa)
- The Republic of Chad (Africa)
- The French Southern and Antarctic Lands (Africa)
- The Togolese Republic (Africa)
- The Republic of Tajikistan (Asia)
- Turkmenistan (Asia)
- The Republic of Tunisia (Africa)
- The Republic of Türkiye (Asia)
- The United Republic of Tanzania (Africa)
- Ukraine (Europe)
- The Republic of Uganda (Africa)
- The Republic of Uzbekistan (Asia)
- The Holy See (Europe)
- The Republic of Yemen (Asia)
- The Department of Mayotte (Africa)
- The Republic of South Africa (Africa)
- The Republic of Zambia (Africa)
- The Republic of Zimbabwe (Africa)
Implementations§
source§impl WorldRegion
impl WorldRegion
sourcepub fn alpha2_list(&self) -> &[&str]
pub fn alpha2_list(&self) -> &[&str]
You can try converting each item to Alpha2 and if you did not include some
country features the conversion will fail.
Trait Implementations§
source§impl Clone for WorldRegion
impl Clone for WorldRegion
source§fn clone(&self) -> WorldRegion
fn clone(&self) -> WorldRegion
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for WorldRegion
impl Debug for WorldRegion
source§impl<'de> Deserialize<'de> for WorldRegion
impl<'de> Deserialize<'de> for WorldRegion
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 PartialEq for WorldRegion
impl PartialEq for WorldRegion
source§fn eq(&self, other: &WorldRegion) -> bool
fn eq(&self, other: &WorldRegion) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for WorldRegion
impl Serialize for WorldRegion
source§impl ToString for WorldRegion
impl ToString for WorldRegion
source§impl TryFrom<&str> for WorldRegion
impl TryFrom<&str> for WorldRegion
impl Copy for WorldRegion
impl StructuralPartialEq for WorldRegion
Auto Trait Implementations§
impl RefUnwindSafe for WorldRegion
impl Send for WorldRegion
impl Sync for WorldRegion
impl Unpin for WorldRegion
impl UnwindSafe for WorldRegion
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more