Enum keshvar::Continent

source ·
pub enum Continent {
    Africa,
    Antarctica,
    Asia,
    Australia,
    Europe,
    NorthAmerica,
    SouthAmerica,
}
Expand description

An enum containing all seven continents.

§Example

use keshvar::{Continent, Alpha2};

let continent = Continent::try_from("australia").unwrap();
let country_list: Vec<_> = continent
    .alpha2_list()
    .iter()
    .map(|alpha2_str| Alpha2::try_from(*alpha2_str).unwrap())
    .collect();
assert!(country_list.contains(&Alpha2::NZ)); // New Zealand

We usually need to convert Alpha2 to Country and use that object instead.

Variants§

§

Africa

  • The Republic of Angola (Africa)
  • Burkina Faso (Africa)
  • The Republic of Burundi (Africa)
  • The Republic of Benin (Africa)
  • The Republic of Botswana (Africa)
  • The Democratic Republic of the Congo (Africa)
  • The Central African Republic (Africa)
  • The Republic of the Congo (Africa)
  • The Republic of Côte d’Ivoire (Africa)
  • The Republic of Cameroon (Africa)
  • The Republic of Cabo Verde (Africa)
  • The Republic of Djibouti (Africa)
  • The People’s Democratic Republic of Algeria (Africa)
  • The Arab Republic of Egypt (Africa)
  • The Sahrawi Arab Democratic Republic (Africa)
  • The State of Eritrea (Africa)
  • The Federal Democratic Republic of Ethiopia (Africa)
  • The Gabonese Republic (Africa)
  • The Republic of Ghana (Africa)
  • The Republic of The Gambia (Africa)
  • The Republic of Guinea (Africa)
  • The Republic of Equatorial Guinea (Africa)
  • The Republic of Guinea-Bissau (Africa)
  • The Republic of Kenya (Africa)
  • The Union of the Comoros (Africa)
  • The Republic of Liberia (Africa)
  • The Kingdom of Lesotho (Africa)
  • The State of Libya (Africa)
  • The Kingdom of Morocco (Africa)
  • The Republic of Madagascar (Africa)
  • The Republic of Mali (Africa)
  • The Islamic Republic of Mauritania (Africa)
  • 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)
  • Réunion (Africa)
  • The Republic of Rwanda (Africa)
  • The Republic of Seychelles (Africa)
  • The Republic of the Sudan (Africa)
  • Saint Helena, Ascension and Tristan da Cunha (Africa)
  • The Republic of Sierra Leone (Africa)
  • 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 Kingdom of Eswatini (Africa)
  • The Republic of Chad (Africa)
  • The French Southern and Antarctic Lands (Africa)
  • The Togolese Republic (Africa)
  • The Republic of Tunisia (Africa)
  • The United Republic of Tanzania (Africa)
  • The Republic of Uganda (Africa)
  • The Department of Mayotte (Africa)
  • The Republic of South Africa (Africa)
  • The Republic of Zambia (Africa)
  • The Republic of Zimbabwe (Africa)
§

Antarctica

  • Antarctica
  • Bouvet Island
  • South Georgia and the South Sandwich Islands (Americas)
  • The Territory of Heard Island and McDonald Islands
§

Asia

  • The United Arab Emirates (Asia)
  • The Islamic Republic of Afghanistan (Asia)
  • The Republic of Armenia (Asia)
  • The Republic of Azerbaijan (Asia)
  • The People’s Republic of Bangladesh (Asia)
  • The Kingdom of Bahrain (Asia)
  • The Nation of Brunei, the Abode of Peace (Asia)
  • The Kingdom of Bhutan (Asia)
  • The Territory of Cocos (Keeling) Islands (Oceania)
  • The People’s Republic of China (Asia)
  • The Territory of Christmas Island (Oceania)
  • The Republic of Cyprus (Asia)
  • Georgia (Asia)
  • The Hong Kong Special Administrative Region of China (Asia)
  • The Republic of Indonesia (Asia)
  • The State of Israel (Asia)
  • The Republic of India (Asia)
  • The British Indian Ocean Territory (Africa)
  • The Republic of Iraq (Asia)
  • The Islamic Republic of Iran (Asia)
  • The Hashemite Kingdom of Jordan (Asia)
  • Japan (Asia)
  • The Kyrgyz Republic (Asia)
  • The Kingdom of Cambodia (Asia)
  • The Democratic People’s Republic of Korea (Asia)
  • The Republic of Korea (Asia)
  • The State of Kuwait (Asia)
  • The Republic of Kazakhstan (Asia)
  • The Lao People’s Democratic Republic (Asia)
  • The Lebanese Republic (Asia)
  • The Democratic Socialist Republic of Sri Lanka (Asia)
  • The Republic of the Union of Myanmar (Asia)
  • Mongolia (Asia)
  • The Macao Special Administrative Region of China (Asia)
  • The Republic of Maldives (Asia)
  • Malaysia (Asia)
  • The Federal Democratic Republic of Nepal (Asia)
  • The Sultanate of Oman (Asia)
  • The Republic of the Philippines (Asia)
  • The Islamic Republic of Pakistan (Asia)
  • The State of Palestine (Asia)
  • The State of Qatar (Asia)
  • The Kingdom of Saudi Arabia (Asia)
  • The Republic of Singapore (Asia)
  • The Syrian Arab Republic (Asia)
  • The Kingdom of Thailand (Asia)
  • The Republic of Tajikistan (Asia)
  • The Democratic Republic of Timor-Leste (Asia)
  • Turkmenistan (Asia)
  • Taiwan, Province of China (Asia)
  • The Republic of Uzbekistan (Asia)
  • The Socialist Republic of Viet Nam (Asia)
  • The Republic of Yemen (Asia)
§

Australia

  • The Territory of American Samoa (Oceania)
  • The Commonwealth of Australia (Oceania)
  • The Cook Islands (Oceania)
  • The Republic of Fiji (Oceania)
  • The Federated States of Micronesia (Oceania)
  • The Territory of Guam (Oceania)
  • The Republic of Kiribati (Oceania)
  • The Republic of the Marshall Islands (Oceania)
  • The Commonwealth of the Northern Mariana Islands (Oceania)
  • New Caledonia (Oceania)
  • The Territory of Norfolk Island (Oceania)
  • The Republic of Nauru (Oceania)
  • Niue (Oceania)
  • New Zealand (Oceania)
  • French Polynesia (Oceania)
  • The Independent State of Papua New Guinea (Oceania)
  • The Pitcairn, Henderson, Ducie and Oeno Islands (Oceania)
  • The Republic of Palau (Oceania)
  • The Solomon Islands (Oceania)
  • Tokelau (Oceania)
  • The Kingdom of Tonga (Oceania)
  • Tuvalu (Oceania)
  • United States Minor Outlying Islands (Americas)
  • The Republic of Vanuatu (Oceania)
  • The Territory of the Wallis and Futuna Islands (Oceania)
  • The Independent State of Samoa (Oceania)
§

Europe

  • The Principality of Andorra (Europe)
  • The Republic of Albania (Europe)
  • The Republic of Austria (Europe)
  • Åland (Europe)
  • Bosnia and Herzegovina (Europe)
  • The Kingdom of Belgium (Europe)
  • The Republic of Bulgaria (Europe)
  • The Republic of Belarus (Europe)
  • The Swiss Confederation (Europe)
  • The Czech Republic (Europe)
  • The Federal Republic of Germany (Europe)
  • The Kingdom of Denmark (Europe)
  • The Republic of Estonia (Europe)
  • The Kingdom of Spain (Europe)
  • The Republic of Finland (Europe)
  • The Faroe Islands (Europe)
  • The French Republic (Europe)
  • The United Kingdom of Great Britain and Northern Ireland (Europe)
  • The Bailiwick of Guernsey (Europe)
  • Gibraltar (Europe)
  • The Hellenic Republic (Europe)
  • The Republic of Croatia (Europe)
  • Hungary (Europe)
  • Ireland (Europe)
  • The Isle of Man (Europe)
  • Iceland (Europe)
  • The Italian Republic (Europe)
  • The Bailiwick of Jersey (Europe)
  • The Principality of Liechtenstein (Europe)
  • The Republic of Lithuania (Europe)
  • The Grand Duchy of Luxembourg (Europe)
  • The Republic of Latvia (Europe)
  • The Principality of Monaco (Europe)
  • The Republic of Moldova (Europe)
  • Montenegro (Europe)
  • The Republic of North Macedonia (Europe)
  • The Republic of Malta (Europe)
  • The Kingdom of the Netherlands (Europe)
  • The Kingdom of Norway (Europe)
  • The Republic of Poland (Europe)
  • The Portuguese Republic (Europe)
  • Romania (Europe)
  • The Republic of Serbia (Europe)
  • The Russian Federation (Europe)
  • The Kingdom of Sweden (Europe)
  • The Republic of Slovenia (Europe)
  • Svalbard and Jan Mayen (Europe)
  • The Slovak Republic (Europe)
  • The Republic of San Marino (Europe)
  • The Republic of Türkiye (Asia)
  • Ukraine (Europe)
  • The Holy See (Europe)
§

NorthAmerica

  • Antigua and Barbuda (Americas)
  • Anguilla (Americas)
  • Aruba (Americas)
  • Barbados (Americas)
  • The Collectivity of Saint-Barthélemy (Americas)
  • Bermuda (Americas)
  • Bonaire, Sint Eustatius and Saba (Americas)
  • The Commonwealth of The Bahamas (Americas)
  • Belize (Americas)
  • Canada (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)
  • Grenada (Americas)
  • Kalaallit Nunaat (Americas)
  • Guadeloupe (Americas)
  • The Republic of Guatemala (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)
  • Montserrat (Americas)
  • The United Mexican States (Americas)
  • The Republic of Nicaragua (Americas)
  • The Republic of Panamá (Americas)
  • The Overseas Collectivity of Saint-Pierre and Miquelon (Americas)
  • The Commonwealth of Puerto Rico (Americas)
  • The Republic of El Salvador (Americas)
  • Sint Maarten (Americas)
  • The Turks and Caicos Islands (Americas)
  • The Republic of Trinidad and Tobago (Americas)
  • The United States of America (Americas)
  • Saint Vincent and the Grenadines (Americas)
  • The Virgin Islands (Americas)
  • The Virgin Islands of the United States (Americas)
§

SouthAmerica

  • The Argentine Republic (Americas)
  • The Plurinational State of Bolivia (Americas)
  • The Federative Republic of Brazil (Americas)
  • The Republic of Chile (Americas)
  • The Republic of Colombia (Americas)
  • The Republic of Ecuador (Americas)
  • The Falkland Islands (Americas)
  • Guyane (Americas)
  • The Co-operative Republic of Guyana (Americas)
  • The Republic of Perú (Americas)
  • The Republic of Paraguay (Americas)
  • The Republic of Suriname (Americas)
  • The Oriental Republic of Uruguay (Americas)
  • The Bolivarian Republic of Venezuela (Americas)

Implementations§

source§

impl Continent

source

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 Continent

source§

fn clone(&self) -> Continent

Returns a copy 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 Continent

source§

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

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

impl<'de> Deserialize<'de> for Continent

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 PartialEq for Continent

source§

fn eq(&self, other: &Continent) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Continent

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 ToString for Continent

source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl TryFrom<&str> for Continent

§

type Error = SearchError

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 Copy for Continent

source§

impl StructuralPartialEq for Continent

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> 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,

§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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>,