#![allow(non_camel_case_types)]
#[cfg_attr(feature = "specta", derive(specta::Type))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
pub enum Country {
Andorra,
UnitedArabEmirates,
Afghanistan,
AntiguaAndBarbuda,
Anguilla,
Albania,
Armenia,
Angola,
Antarctica,
Argentina,
AmericanSamoa,
Austria,
Australia,
Aruba,
ÅlandIslands,
Azerbaijan,
BosniaAndHerzegovina,
Barbados,
Bangladesh,
Belgium,
BurkinaFaso,
Bulgaria,
Bahrain,
Burundi,
Benin,
SaintBarthélemy,
Bermuda,
BruneiDarussalam,
BoliviaPlurinationalState,
BonaireSintEustatiusAndSaba,
Brazil,
Bahamas,
Bhutan,
BouvetIsland,
Botswana,
Belarus,
Belize,
Canada,
CocosKeelingIslands,
CongoDemocraticRepublic,
CentralAfricanRepublic,
Congo,
Switzerland,
CôteDivoire,
CookIslands,
Chile,
Cameroon,
China,
Colombia,
CostaRica,
Cuba,
CaboVerde,
Curaçao,
ChristmasIsland,
Cyprus,
Czechia,
Germany,
Djibouti,
Denmark,
Dominica,
DominicanRepublic,
Algeria,
Ecuador,
Estonia,
Egypt,
WesternSahara,
Eritrea,
Spain,
Ethiopia,
Finland,
Fiji,
FalklandIslandsMalvinas,
MicronesiaFederatedStates,
FaroeIslands,
France,
Gabon,
UnitedKingdomGreatBritainAndNorthernIreland,
Grenada,
Georgia,
FrenchGuiana,
Guernsey,
Ghana,
Gibraltar,
Greenland,
Gambia,
Guinea,
Guadeloupe,
EquatorialGuinea,
Greece,
SouthGeorgiaAndSouthSandwichIslands,
Guatemala,
Guam,
GuineaBissau,
Guyana,
HongKong,
HeardIslandAndMcdonaldIslands,
Honduras,
Croatia,
Haiti,
Hungary,
Indonesia,
Ireland,
Israel,
IsleMan,
India,
BritishIndianOceanTerritory,
Iraq,
IranIslamicRepublic,
Iceland,
Italy,
Jersey,
Jamaica,
Jordan,
Japan,
Kenya,
Kyrgyzstan,
Cambodia,
Kiribati,
Comoros,
SaintKittsAndNevis,
KoreaDemocraticPeoplesRepublic,
KoreaRepublic,
Kuwait,
CaymanIslands,
Kazakhstan,
LaoPeoplesDemocraticRepublic,
Lebanon,
SaintLucia,
Liechtenstein,
SriLanka,
Liberia,
Lesotho,
Lithuania,
Luxembourg,
Latvia,
Libya,
Morocco,
Monaco,
MoldovaRepublic,
Montenegro,
SaintMartinFrenchPart,
Madagascar,
MarshallIslands,
NorthMacedonia,
Mali,
Myanmar,
Mongolia,
Macao,
NorthernMarianaIslands,
Martinique,
Mauritania,
Montserrat,
Malta,
Mauritius,
Maldives,
Malawi,
Mexico,
Malaysia,
Mozambique,
Namibia,
NewCaledonia,
Niger,
NorfolkIsland,
Nigeria,
Nicaragua,
Netherlands,
Norway,
Nepal,
Nauru,
Niue,
NewZealand,
Oman,
Panama,
Peru,
FrenchPolynesia,
PapuaNewGuinea,
Philippines,
Pakistan,
Poland,
SaintPierreAndMiquelon,
Pitcairn,
PuertoRico,
PalestineState,
Portugal,
Palau,
Paraguay,
Qatar,
Réunion,
Romania,
Serbia,
RussianFederation,
Rwanda,
SaudiArabia,
SolomonIslands,
Seychelles,
Sudan,
Sweden,
Singapore,
SaintHelenaAscensionAndTristanDaCunha,
Slovenia,
SvalbardAndJanMayen,
Slovakia,
SierraLeone,
SanMarino,
Senegal,
Somalia,
Suriname,
SouthSudan,
SaoTomeAndPrincipe,
ElSalvador,
SintMaartenDutchPart,
SyrianArabRepublic,
Eswatini,
TurksAndCaicosIslands,
Chad,
FrenchSouthernTerritories,
Togo,
Thailand,
Tajikistan,
Tokelau,
TimorLeste,
Turkmenistan,
Tunisia,
Tonga,
Türkiye,
TrinidadAndTobago,
Tuvalu,
TaiwanProvinceChina,
TanzaniaUnitedRepublic,
Ukraine,
Uganda,
UnitedStatesMinorOutlyingIslands,
UnitedStatesAmerica,
Uruguay,
Uzbekistan,
HolySee,
SaintVincentAndGrenadines,
VenezuelaBolivarianRepublic,
VirginIslandsBritish,
VirginIslandsUS,
VietNam,
Vanuatu,
WallisAndFutuna,
Samoa,
Yemen,
Mayotte,
SouthAfrica,
Zambia,
Zimbabwe,
Kosovo,
UnitedKingdomNorthernIreland,
}
impl std::fmt::Display for Country {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", <Self as crate::Code>::code(*self))
}
}
impl std::str::FromStr for Country {
type Err = crate::ParseError<Self>;
fn from_str(s: &str) -> Result<Self, Self::Err> {
<Self as crate::FromCode>::from_code(s)
.ok_or_else(|| crate::ParseError::<Self>::new(s.to_owned()))
}
}
impl crate::Code for Country {
fn code(self) -> &'static str {
match self {
Country::Andorra => "AD",
Country::UnitedArabEmirates => "AE",
Country::Afghanistan => "AF",
Country::AntiguaAndBarbuda => "AG",
Country::Anguilla => "AI",
Country::Albania => "AL",
Country::Armenia => "AM",
Country::Angola => "AO",
Country::Antarctica => "AQ",
Country::Argentina => "AR",
Country::AmericanSamoa => "AS",
Country::Austria => "AT",
Country::Australia => "AU",
Country::Aruba => "AW",
Country::ÅlandIslands => "AX",
Country::Azerbaijan => "AZ",
Country::BosniaAndHerzegovina => "BA",
Country::Barbados => "BB",
Country::Bangladesh => "BD",
Country::Belgium => "BE",
Country::BurkinaFaso => "BF",
Country::Bulgaria => "BG",
Country::Bahrain => "BH",
Country::Burundi => "BI",
Country::Benin => "BJ",
Country::SaintBarthélemy => "BL",
Country::Bermuda => "BM",
Country::BruneiDarussalam => "BN",
Country::BoliviaPlurinationalState => "BO",
Country::BonaireSintEustatiusAndSaba => "BQ",
Country::Brazil => "BR",
Country::Bahamas => "BS",
Country::Bhutan => "BT",
Country::BouvetIsland => "BV",
Country::Botswana => "BW",
Country::Belarus => "BY",
Country::Belize => "BZ",
Country::Canada => "CA",
Country::CocosKeelingIslands => "CC",
Country::CongoDemocraticRepublic => "CD",
Country::CentralAfricanRepublic => "CF",
Country::Congo => "CG",
Country::Switzerland => "CH",
Country::CôteDivoire => "CI",
Country::CookIslands => "CK",
Country::Chile => "CL",
Country::Cameroon => "CM",
Country::China => "CN",
Country::Colombia => "CO",
Country::CostaRica => "CR",
Country::Cuba => "CU",
Country::CaboVerde => "CV",
Country::Curaçao => "CW",
Country::ChristmasIsland => "CX",
Country::Cyprus => "CY",
Country::Czechia => "CZ",
Country::Germany => "DE",
Country::Djibouti => "DJ",
Country::Denmark => "DK",
Country::Dominica => "DM",
Country::DominicanRepublic => "DO",
Country::Algeria => "DZ",
Country::Ecuador => "EC",
Country::Estonia => "EE",
Country::Egypt => "EG",
Country::WesternSahara => "EH",
Country::Eritrea => "ER",
Country::Spain => "ES",
Country::Ethiopia => "ET",
Country::Finland => "FI",
Country::Fiji => "FJ",
Country::FalklandIslandsMalvinas => "FK",
Country::MicronesiaFederatedStates => "FM",
Country::FaroeIslands => "FO",
Country::France => "FR",
Country::Gabon => "GA",
Country::UnitedKingdomGreatBritainAndNorthernIreland => "GB",
Country::Grenada => "GD",
Country::Georgia => "GE",
Country::FrenchGuiana => "GF",
Country::Guernsey => "GG",
Country::Ghana => "GH",
Country::Gibraltar => "GI",
Country::Greenland => "GL",
Country::Gambia => "GM",
Country::Guinea => "GN",
Country::Guadeloupe => "GP",
Country::EquatorialGuinea => "GQ",
Country::Greece => "GR",
Country::SouthGeorgiaAndSouthSandwichIslands => "GS",
Country::Guatemala => "GT",
Country::Guam => "GU",
Country::GuineaBissau => "GW",
Country::Guyana => "GY",
Country::HongKong => "HK",
Country::HeardIslandAndMcdonaldIslands => "HM",
Country::Honduras => "HN",
Country::Croatia => "HR",
Country::Haiti => "HT",
Country::Hungary => "HU",
Country::Indonesia => "ID",
Country::Ireland => "IE",
Country::Israel => "IL",
Country::IsleMan => "IM",
Country::India => "IN",
Country::BritishIndianOceanTerritory => "IO",
Country::Iraq => "IQ",
Country::IranIslamicRepublic => "IR",
Country::Iceland => "IS",
Country::Italy => "IT",
Country::Jersey => "JE",
Country::Jamaica => "JM",
Country::Jordan => "JO",
Country::Japan => "JP",
Country::Kenya => "KE",
Country::Kyrgyzstan => "KG",
Country::Cambodia => "KH",
Country::Kiribati => "KI",
Country::Comoros => "KM",
Country::SaintKittsAndNevis => "KN",
Country::KoreaDemocraticPeoplesRepublic => "KP",
Country::KoreaRepublic => "KR",
Country::Kuwait => "KW",
Country::CaymanIslands => "KY",
Country::Kazakhstan => "KZ",
Country::LaoPeoplesDemocraticRepublic => "LA",
Country::Lebanon => "LB",
Country::SaintLucia => "LC",
Country::Liechtenstein => "LI",
Country::SriLanka => "LK",
Country::Liberia => "LR",
Country::Lesotho => "LS",
Country::Lithuania => "LT",
Country::Luxembourg => "LU",
Country::Latvia => "LV",
Country::Libya => "LY",
Country::Morocco => "MA",
Country::Monaco => "MC",
Country::MoldovaRepublic => "MD",
Country::Montenegro => "ME",
Country::SaintMartinFrenchPart => "MF",
Country::Madagascar => "MG",
Country::MarshallIslands => "MH",
Country::NorthMacedonia => "MK",
Country::Mali => "ML",
Country::Myanmar => "MM",
Country::Mongolia => "MN",
Country::Macao => "MO",
Country::NorthernMarianaIslands => "MP",
Country::Martinique => "MQ",
Country::Mauritania => "MR",
Country::Montserrat => "MS",
Country::Malta => "MT",
Country::Mauritius => "MU",
Country::Maldives => "MV",
Country::Malawi => "MW",
Country::Mexico => "MX",
Country::Malaysia => "MY",
Country::Mozambique => "MZ",
Country::Namibia => "NA",
Country::NewCaledonia => "NC",
Country::Niger => "NE",
Country::NorfolkIsland => "NF",
Country::Nigeria => "NG",
Country::Nicaragua => "NI",
Country::Netherlands => "NL",
Country::Norway => "NO",
Country::Nepal => "NP",
Country::Nauru => "NR",
Country::Niue => "NU",
Country::NewZealand => "NZ",
Country::Oman => "OM",
Country::Panama => "PA",
Country::Peru => "PE",
Country::FrenchPolynesia => "PF",
Country::PapuaNewGuinea => "PG",
Country::Philippines => "PH",
Country::Pakistan => "PK",
Country::Poland => "PL",
Country::SaintPierreAndMiquelon => "PM",
Country::Pitcairn => "PN",
Country::PuertoRico => "PR",
Country::PalestineState => "PS",
Country::Portugal => "PT",
Country::Palau => "PW",
Country::Paraguay => "PY",
Country::Qatar => "QA",
Country::Réunion => "RE",
Country::Romania => "RO",
Country::Serbia => "RS",
Country::RussianFederation => "RU",
Country::Rwanda => "RW",
Country::SaudiArabia => "SA",
Country::SolomonIslands => "SB",
Country::Seychelles => "SC",
Country::Sudan => "SD",
Country::Sweden => "SE",
Country::Singapore => "SG",
Country::SaintHelenaAscensionAndTristanDaCunha => "SH",
Country::Slovenia => "SI",
Country::SvalbardAndJanMayen => "SJ",
Country::Slovakia => "SK",
Country::SierraLeone => "SL",
Country::SanMarino => "SM",
Country::Senegal => "SN",
Country::Somalia => "SO",
Country::Suriname => "SR",
Country::SouthSudan => "SS",
Country::SaoTomeAndPrincipe => "ST",
Country::ElSalvador => "SV",
Country::SintMaartenDutchPart => "SX",
Country::SyrianArabRepublic => "SY",
Country::Eswatini => "SZ",
Country::TurksAndCaicosIslands => "TC",
Country::Chad => "TD",
Country::FrenchSouthernTerritories => "TF",
Country::Togo => "TG",
Country::Thailand => "TH",
Country::Tajikistan => "TJ",
Country::Tokelau => "TK",
Country::TimorLeste => "TL",
Country::Turkmenistan => "TM",
Country::Tunisia => "TN",
Country::Tonga => "TO",
Country::Türkiye => "TR",
Country::TrinidadAndTobago => "TT",
Country::Tuvalu => "TV",
Country::TaiwanProvinceChina => "TW",
Country::TanzaniaUnitedRepublic => "TZ",
Country::Ukraine => "UA",
Country::Uganda => "UG",
Country::UnitedStatesMinorOutlyingIslands => "UM",
Country::UnitedStatesAmerica => "US",
Country::Uruguay => "UY",
Country::Uzbekistan => "UZ",
Country::HolySee => "VA",
Country::SaintVincentAndGrenadines => "VC",
Country::VenezuelaBolivarianRepublic => "VE",
Country::VirginIslandsBritish => "VG",
Country::VirginIslandsUS => "VI",
Country::VietNam => "VN",
Country::Vanuatu => "VU",
Country::WallisAndFutuna => "WF",
Country::Samoa => "WS",
Country::Yemen => "YE",
Country::Mayotte => "YT",
Country::SouthAfrica => "ZA",
Country::Zambia => "ZM",
Country::Zimbabwe => "ZW",
Country::Kosovo => "1A",
Country::UnitedKingdomNorthernIreland => "XI",
}
}
}
impl crate::Description for Country {
fn description(self) -> &'static str {
match self {
Country::Andorra => "Andorra",
Country::UnitedArabEmirates => "United Arab Emirates (the)",
Country::Afghanistan => "Afghanistan",
Country::AntiguaAndBarbuda => "Antigua and Barbuda",
Country::Anguilla => "Anguilla",
Country::Albania => "Albania",
Country::Armenia => "Armenia",
Country::Angola => "Angola",
Country::Antarctica => "Antarctica",
Country::Argentina => "Argentina",
Country::AmericanSamoa => "American Samoa",
Country::Austria => "Austria",
Country::Australia => "Australia",
Country::Aruba => "Aruba",
Country::ÅlandIslands => "Åland Islands",
Country::Azerbaijan => "Azerbaijan",
Country::BosniaAndHerzegovina => "Bosnia and Herzegovina",
Country::Barbados => "Barbados",
Country::Bangladesh => "Bangladesh",
Country::Belgium => "Belgium",
Country::BurkinaFaso => "Burkina Faso",
Country::Bulgaria => "Bulgaria",
Country::Bahrain => "Bahrain",
Country::Burundi => "Burundi",
Country::Benin => "Benin",
Country::SaintBarthélemy => "Saint Barthélemy",
Country::Bermuda => "Bermuda",
Country::BruneiDarussalam => "Brunei Darussalam",
Country::BoliviaPlurinationalState => "Bolivia (Plurinational State of)",
Country::BonaireSintEustatiusAndSaba => "Bonaire, Sint Eustatius and Saba",
Country::Brazil => "Brazil",
Country::Bahamas => "Bahamas (the)",
Country::Bhutan => "Bhutan",
Country::BouvetIsland => "Bouvet Island",
Country::Botswana => "Botswana",
Country::Belarus => "Belarus",
Country::Belize => "Belize",
Country::Canada => "Canada",
Country::CocosKeelingIslands => "Cocos (Keeling) Islands (the)",
Country::CongoDemocraticRepublic => "Congo (the Democratic Republic of the)",
Country::CentralAfricanRepublic => "Central African Republic (the)",
Country::Congo => "Congo (the)",
Country::Switzerland => "Switzerland",
Country::CôteDivoire => "Côte d'Ivoire",
Country::CookIslands => "Cook Islands (the)",
Country::Chile => "Chile",
Country::Cameroon => "Cameroon",
Country::China => "China",
Country::Colombia => "Colombia",
Country::CostaRica => "Costa Rica",
Country::Cuba => "Cuba",
Country::CaboVerde => "Cabo Verde",
Country::Curaçao => "Curaçao",
Country::ChristmasIsland => "Christmas Island",
Country::Cyprus => "Cyprus",
Country::Czechia => "Czechia",
Country::Germany => "Germany",
Country::Djibouti => "Djibouti",
Country::Denmark => "Denmark",
Country::Dominica => "Dominica",
Country::DominicanRepublic => "Dominican Republic (the)",
Country::Algeria => "Algeria",
Country::Ecuador => "Ecuador",
Country::Estonia => "Estonia",
Country::Egypt => "Egypt",
Country::WesternSahara => "Western Sahara*",
Country::Eritrea => "Eritrea",
Country::Spain => "Spain",
Country::Ethiopia => "Ethiopia",
Country::Finland => "Finland",
Country::Fiji => "Fiji",
Country::FalklandIslandsMalvinas => "Falkland Islands (the) [Malvinas]",
Country::MicronesiaFederatedStates => "Micronesia (Federated States of)",
Country::FaroeIslands => "Faroe Islands (the)",
Country::France => "France",
Country::Gabon => "Gabon",
Country::UnitedKingdomGreatBritainAndNorthernIreland => {
"United Kingdom of Great Britain and Northern Ireland (the)"
}
Country::Grenada => "Grenada",
Country::Georgia => "Georgia",
Country::FrenchGuiana => "French Guiana",
Country::Guernsey => "Guernsey",
Country::Ghana => "Ghana",
Country::Gibraltar => "Gibraltar",
Country::Greenland => "Greenland",
Country::Gambia => "Gambia (the)",
Country::Guinea => "Guinea",
Country::Guadeloupe => "Guadeloupe",
Country::EquatorialGuinea => "Equatorial Guinea",
Country::Greece => "Greece",
Country::SouthGeorgiaAndSouthSandwichIslands => {
"South Georgia and the South Sandwich Islands"
}
Country::Guatemala => "Guatemala",
Country::Guam => "Guam",
Country::GuineaBissau => "Guinea-Bissau",
Country::Guyana => "Guyana",
Country::HongKong => "Hong Kong",
Country::HeardIslandAndMcdonaldIslands => "Heard Island and McDonald Islands",
Country::Honduras => "Honduras",
Country::Croatia => "Croatia",
Country::Haiti => "Haiti",
Country::Hungary => "Hungary",
Country::Indonesia => "Indonesia",
Country::Ireland => "Ireland",
Country::Israel => "Israel",
Country::IsleMan => "Isle of Man",
Country::India => "India",
Country::BritishIndianOceanTerritory => "British Indian Ocean Territory (the)",
Country::Iraq => "Iraq",
Country::IranIslamicRepublic => "Iran (Islamic Republic of)",
Country::Iceland => "Iceland",
Country::Italy => "Italy",
Country::Jersey => "Jersey",
Country::Jamaica => "Jamaica",
Country::Jordan => "Jordan",
Country::Japan => "Japan",
Country::Kenya => "Kenya",
Country::Kyrgyzstan => "Kyrgyzstan",
Country::Cambodia => "Cambodia",
Country::Kiribati => "Kiribati",
Country::Comoros => "Comoros (the)",
Country::SaintKittsAndNevis => "Saint Kitts and Nevis",
Country::KoreaDemocraticPeoplesRepublic => {
"Korea (the Democratic People's Republic of)"
}
Country::KoreaRepublic => "Korea (the Republic of)",
Country::Kuwait => "Kuwait",
Country::CaymanIslands => "Cayman Islands (the)",
Country::Kazakhstan => "Kazakhstan",
Country::LaoPeoplesDemocraticRepublic => "Lao People's Democratic Republic (the)",
Country::Lebanon => "Lebanon",
Country::SaintLucia => "Saint Lucia",
Country::Liechtenstein => "Liechtenstein",
Country::SriLanka => "Sri Lanka",
Country::Liberia => "Liberia",
Country::Lesotho => "Lesotho",
Country::Lithuania => "Lithuania",
Country::Luxembourg => "Luxembourg",
Country::Latvia => "Latvia",
Country::Libya => "Libya",
Country::Morocco => "Morocco",
Country::Monaco => "Monaco",
Country::MoldovaRepublic => "Moldova (the Republic of)",
Country::Montenegro => "Montenegro",
Country::SaintMartinFrenchPart => "Saint Martin (French part)",
Country::Madagascar => "Madagascar",
Country::MarshallIslands => "Marshall Islands (the)",
Country::NorthMacedonia => "North Macedonia",
Country::Mali => "Mali",
Country::Myanmar => "Myanmar",
Country::Mongolia => "Mongolia",
Country::Macao => "Macao",
Country::NorthernMarianaIslands => "Northern Mariana Islands (the)",
Country::Martinique => "Martinique",
Country::Mauritania => "Mauritania",
Country::Montserrat => "Montserrat",
Country::Malta => "Malta",
Country::Mauritius => "Mauritius",
Country::Maldives => "Maldives",
Country::Malawi => "Malawi",
Country::Mexico => "Mexico",
Country::Malaysia => "Malaysia",
Country::Mozambique => "Mozambique",
Country::Namibia => "Namibia",
Country::NewCaledonia => "New Caledonia",
Country::Niger => "Niger (the)",
Country::NorfolkIsland => "Norfolk Island",
Country::Nigeria => "Nigeria",
Country::Nicaragua => "Nicaragua",
Country::Netherlands => "Netherlands (the)",
Country::Norway => "Norway",
Country::Nepal => "Nepal",
Country::Nauru => "Nauru",
Country::Niue => "Niue",
Country::NewZealand => "New Zealand",
Country::Oman => "Oman",
Country::Panama => "Panama",
Country::Peru => "Peru",
Country::FrenchPolynesia => "French Polynesia",
Country::PapuaNewGuinea => "Papua New Guinea",
Country::Philippines => "Philippines (the)",
Country::Pakistan => "Pakistan",
Country::Poland => "Poland",
Country::SaintPierreAndMiquelon => "Saint Pierre and Miquelon",
Country::Pitcairn => "Pitcairn",
Country::PuertoRico => "Puerto Rico",
Country::PalestineState => "Palestine, State of",
Country::Portugal => "Portugal",
Country::Palau => "Palau",
Country::Paraguay => "Paraguay",
Country::Qatar => "Qatar",
Country::Réunion => "Réunion",
Country::Romania => "Romania",
Country::Serbia => "Serbia",
Country::RussianFederation => "Russian Federation (the)",
Country::Rwanda => "Rwanda",
Country::SaudiArabia => "Saudi Arabia",
Country::SolomonIslands => "Solomon Islands",
Country::Seychelles => "Seychelles",
Country::Sudan => "Sudan (the)",
Country::Sweden => "Sweden",
Country::Singapore => "Singapore",
Country::SaintHelenaAscensionAndTristanDaCunha => {
"Saint Helena, Ascension and Tristan da Cunha"
}
Country::Slovenia => "Slovenia",
Country::SvalbardAndJanMayen => "Svalbard and Jan Mayen",
Country::Slovakia => "Slovakia",
Country::SierraLeone => "Sierra Leone",
Country::SanMarino => "San Marino",
Country::Senegal => "Senegal",
Country::Somalia => "Somalia",
Country::Suriname => "Suriname",
Country::SouthSudan => "South Sudan",
Country::SaoTomeAndPrincipe => "Sao Tome and Principe",
Country::ElSalvador => "El Salvador",
Country::SintMaartenDutchPart => "Sint Maarten (Dutch part)",
Country::SyrianArabRepublic => "Syrian Arab Republic (the)",
Country::Eswatini => "Eswatini",
Country::TurksAndCaicosIslands => "Turks and Caicos Islands (the)",
Country::Chad => "Chad",
Country::FrenchSouthernTerritories => "French Southern Territories (the)",
Country::Togo => "Togo",
Country::Thailand => "Thailand",
Country::Tajikistan => "Tajikistan",
Country::Tokelau => "Tokelau",
Country::TimorLeste => "Timor-Leste",
Country::Turkmenistan => "Turkmenistan",
Country::Tunisia => "Tunisia",
Country::Tonga => "Tonga",
Country::Türkiye => "Türkiye",
Country::TrinidadAndTobago => "Trinidad and Tobago",
Country::Tuvalu => "Tuvalu",
Country::TaiwanProvinceChina => "Taiwan (Province of China)",
Country::TanzaniaUnitedRepublic => "Tanzania, the United Republic of",
Country::Ukraine => "Ukraine",
Country::Uganda => "Uganda",
Country::UnitedStatesMinorOutlyingIslands => {
"United States Minor Outlying Islands (the)"
}
Country::UnitedStatesAmerica => "United States of America (the)",
Country::Uruguay => "Uruguay",
Country::Uzbekistan => "Uzbekistan",
Country::HolySee => "Holy See (the)",
Country::SaintVincentAndGrenadines => "Saint Vincent and the Grenadines",
Country::VenezuelaBolivarianRepublic => "Venezuela (Bolivarian Republic of)",
Country::VirginIslandsBritish => "Virgin Islands (British)",
Country::VirginIslandsUS => "Virgin Islands (U.S.)",
Country::VietNam => "Viet Nam",
Country::Vanuatu => "Vanuatu",
Country::WallisAndFutuna => "Wallis and Futuna",
Country::Samoa => "Samoa",
Country::Yemen => "Yemen",
Country::Mayotte => "Mayotte",
Country::SouthAfrica => "South Africa",
Country::Zambia => "Zambia",
Country::Zimbabwe => "Zimbabwe",
Country::Kosovo => "Kosovo",
Country::UnitedKingdomNorthernIreland => "United Kingdom (Northern Ireland)",
}
}
}
impl crate::FromCode for Country {
fn from_code(code: &str) -> Option<Self>
where
Self: Sized,
{
match code {
"AD" => Some(Country::Andorra),
"AE" => Some(Country::UnitedArabEmirates),
"AF" => Some(Country::Afghanistan),
"AG" => Some(Country::AntiguaAndBarbuda),
"AI" => Some(Country::Anguilla),
"AL" => Some(Country::Albania),
"AM" => Some(Country::Armenia),
"AO" => Some(Country::Angola),
"AQ" => Some(Country::Antarctica),
"AR" => Some(Country::Argentina),
"AS" => Some(Country::AmericanSamoa),
"AT" => Some(Country::Austria),
"AU" => Some(Country::Australia),
"AW" => Some(Country::Aruba),
"AX" => Some(Country::ÅlandIslands),
"AZ" => Some(Country::Azerbaijan),
"BA" => Some(Country::BosniaAndHerzegovina),
"BB" => Some(Country::Barbados),
"BD" => Some(Country::Bangladesh),
"BE" => Some(Country::Belgium),
"BF" => Some(Country::BurkinaFaso),
"BG" => Some(Country::Bulgaria),
"BH" => Some(Country::Bahrain),
"BI" => Some(Country::Burundi),
"BJ" => Some(Country::Benin),
"BL" => Some(Country::SaintBarthélemy),
"BM" => Some(Country::Bermuda),
"BN" => Some(Country::BruneiDarussalam),
"BO" => Some(Country::BoliviaPlurinationalState),
"BQ" => Some(Country::BonaireSintEustatiusAndSaba),
"BR" => Some(Country::Brazil),
"BS" => Some(Country::Bahamas),
"BT" => Some(Country::Bhutan),
"BV" => Some(Country::BouvetIsland),
"BW" => Some(Country::Botswana),
"BY" => Some(Country::Belarus),
"BZ" => Some(Country::Belize),
"CA" => Some(Country::Canada),
"CC" => Some(Country::CocosKeelingIslands),
"CD" => Some(Country::CongoDemocraticRepublic),
"CF" => Some(Country::CentralAfricanRepublic),
"CG" => Some(Country::Congo),
"CH" => Some(Country::Switzerland),
"CI" => Some(Country::CôteDivoire),
"CK" => Some(Country::CookIslands),
"CL" => Some(Country::Chile),
"CM" => Some(Country::Cameroon),
"CN" => Some(Country::China),
"CO" => Some(Country::Colombia),
"CR" => Some(Country::CostaRica),
"CU" => Some(Country::Cuba),
"CV" => Some(Country::CaboVerde),
"CW" => Some(Country::Curaçao),
"CX" => Some(Country::ChristmasIsland),
"CY" => Some(Country::Cyprus),
"CZ" => Some(Country::Czechia),
"DE" => Some(Country::Germany),
"DJ" => Some(Country::Djibouti),
"DK" => Some(Country::Denmark),
"DM" => Some(Country::Dominica),
"DO" => Some(Country::DominicanRepublic),
"DZ" => Some(Country::Algeria),
"EC" => Some(Country::Ecuador),
"EE" => Some(Country::Estonia),
"EG" => Some(Country::Egypt),
"EH" => Some(Country::WesternSahara),
"ER" => Some(Country::Eritrea),
"ES" => Some(Country::Spain),
"ET" => Some(Country::Ethiopia),
"FI" => Some(Country::Finland),
"FJ" => Some(Country::Fiji),
"FK" => Some(Country::FalklandIslandsMalvinas),
"FM" => Some(Country::MicronesiaFederatedStates),
"FO" => Some(Country::FaroeIslands),
"FR" => Some(Country::France),
"GA" => Some(Country::Gabon),
"GB" => Some(Country::UnitedKingdomGreatBritainAndNorthernIreland),
"GD" => Some(Country::Grenada),
"GE" => Some(Country::Georgia),
"GF" => Some(Country::FrenchGuiana),
"GG" => Some(Country::Guernsey),
"GH" => Some(Country::Ghana),
"GI" => Some(Country::Gibraltar),
"GL" => Some(Country::Greenland),
"GM" => Some(Country::Gambia),
"GN" => Some(Country::Guinea),
"GP" => Some(Country::Guadeloupe),
"GQ" => Some(Country::EquatorialGuinea),
"GR" => Some(Country::Greece),
"GS" => Some(Country::SouthGeorgiaAndSouthSandwichIslands),
"GT" => Some(Country::Guatemala),
"GU" => Some(Country::Guam),
"GW" => Some(Country::GuineaBissau),
"GY" => Some(Country::Guyana),
"HK" => Some(Country::HongKong),
"HM" => Some(Country::HeardIslandAndMcdonaldIslands),
"HN" => Some(Country::Honduras),
"HR" => Some(Country::Croatia),
"HT" => Some(Country::Haiti),
"HU" => Some(Country::Hungary),
"ID" => Some(Country::Indonesia),
"IE" => Some(Country::Ireland),
"IL" => Some(Country::Israel),
"IM" => Some(Country::IsleMan),
"IN" => Some(Country::India),
"IO" => Some(Country::BritishIndianOceanTerritory),
"IQ" => Some(Country::Iraq),
"IR" => Some(Country::IranIslamicRepublic),
"IS" => Some(Country::Iceland),
"IT" => Some(Country::Italy),
"JE" => Some(Country::Jersey),
"JM" => Some(Country::Jamaica),
"JO" => Some(Country::Jordan),
"JP" => Some(Country::Japan),
"KE" => Some(Country::Kenya),
"KG" => Some(Country::Kyrgyzstan),
"KH" => Some(Country::Cambodia),
"KI" => Some(Country::Kiribati),
"KM" => Some(Country::Comoros),
"KN" => Some(Country::SaintKittsAndNevis),
"KP" => Some(Country::KoreaDemocraticPeoplesRepublic),
"KR" => Some(Country::KoreaRepublic),
"KW" => Some(Country::Kuwait),
"KY" => Some(Country::CaymanIslands),
"KZ" => Some(Country::Kazakhstan),
"LA" => Some(Country::LaoPeoplesDemocraticRepublic),
"LB" => Some(Country::Lebanon),
"LC" => Some(Country::SaintLucia),
"LI" => Some(Country::Liechtenstein),
"LK" => Some(Country::SriLanka),
"LR" => Some(Country::Liberia),
"LS" => Some(Country::Lesotho),
"LT" => Some(Country::Lithuania),
"LU" => Some(Country::Luxembourg),
"LV" => Some(Country::Latvia),
"LY" => Some(Country::Libya),
"MA" => Some(Country::Morocco),
"MC" => Some(Country::Monaco),
"MD" => Some(Country::MoldovaRepublic),
"ME" => Some(Country::Montenegro),
"MF" => Some(Country::SaintMartinFrenchPart),
"MG" => Some(Country::Madagascar),
"MH" => Some(Country::MarshallIslands),
"MK" => Some(Country::NorthMacedonia),
"ML" => Some(Country::Mali),
"MM" => Some(Country::Myanmar),
"MN" => Some(Country::Mongolia),
"MO" => Some(Country::Macao),
"MP" => Some(Country::NorthernMarianaIslands),
"MQ" => Some(Country::Martinique),
"MR" => Some(Country::Mauritania),
"MS" => Some(Country::Montserrat),
"MT" => Some(Country::Malta),
"MU" => Some(Country::Mauritius),
"MV" => Some(Country::Maldives),
"MW" => Some(Country::Malawi),
"MX" => Some(Country::Mexico),
"MY" => Some(Country::Malaysia),
"MZ" => Some(Country::Mozambique),
"NA" => Some(Country::Namibia),
"NC" => Some(Country::NewCaledonia),
"NE" => Some(Country::Niger),
"NF" => Some(Country::NorfolkIsland),
"NG" => Some(Country::Nigeria),
"NI" => Some(Country::Nicaragua),
"NL" => Some(Country::Netherlands),
"NO" => Some(Country::Norway),
"NP" => Some(Country::Nepal),
"NR" => Some(Country::Nauru),
"NU" => Some(Country::Niue),
"NZ" => Some(Country::NewZealand),
"OM" => Some(Country::Oman),
"PA" => Some(Country::Panama),
"PE" => Some(Country::Peru),
"PF" => Some(Country::FrenchPolynesia),
"PG" => Some(Country::PapuaNewGuinea),
"PH" => Some(Country::Philippines),
"PK" => Some(Country::Pakistan),
"PL" => Some(Country::Poland),
"PM" => Some(Country::SaintPierreAndMiquelon),
"PN" => Some(Country::Pitcairn),
"PR" => Some(Country::PuertoRico),
"PS" => Some(Country::PalestineState),
"PT" => Some(Country::Portugal),
"PW" => Some(Country::Palau),
"PY" => Some(Country::Paraguay),
"QA" => Some(Country::Qatar),
"RE" => Some(Country::Réunion),
"RO" => Some(Country::Romania),
"RS" => Some(Country::Serbia),
"RU" => Some(Country::RussianFederation),
"RW" => Some(Country::Rwanda),
"SA" => Some(Country::SaudiArabia),
"SB" => Some(Country::SolomonIslands),
"SC" => Some(Country::Seychelles),
"SD" => Some(Country::Sudan),
"SE" => Some(Country::Sweden),
"SG" => Some(Country::Singapore),
"SH" => Some(Country::SaintHelenaAscensionAndTristanDaCunha),
"SI" => Some(Country::Slovenia),
"SJ" => Some(Country::SvalbardAndJanMayen),
"SK" => Some(Country::Slovakia),
"SL" => Some(Country::SierraLeone),
"SM" => Some(Country::SanMarino),
"SN" => Some(Country::Senegal),
"SO" => Some(Country::Somalia),
"SR" => Some(Country::Suriname),
"SS" => Some(Country::SouthSudan),
"ST" => Some(Country::SaoTomeAndPrincipe),
"SV" => Some(Country::ElSalvador),
"SX" => Some(Country::SintMaartenDutchPart),
"SY" => Some(Country::SyrianArabRepublic),
"SZ" => Some(Country::Eswatini),
"TC" => Some(Country::TurksAndCaicosIslands),
"TD" => Some(Country::Chad),
"TF" => Some(Country::FrenchSouthernTerritories),
"TG" => Some(Country::Togo),
"TH" => Some(Country::Thailand),
"TJ" => Some(Country::Tajikistan),
"TK" => Some(Country::Tokelau),
"TL" => Some(Country::TimorLeste),
"TM" => Some(Country::Turkmenistan),
"TN" => Some(Country::Tunisia),
"TO" => Some(Country::Tonga),
"TR" => Some(Country::Türkiye),
"TT" => Some(Country::TrinidadAndTobago),
"TV" => Some(Country::Tuvalu),
"TW" => Some(Country::TaiwanProvinceChina),
"TZ" => Some(Country::TanzaniaUnitedRepublic),
"UA" => Some(Country::Ukraine),
"UG" => Some(Country::Uganda),
"UM" => Some(Country::UnitedStatesMinorOutlyingIslands),
"US" => Some(Country::UnitedStatesAmerica),
"UY" => Some(Country::Uruguay),
"UZ" => Some(Country::Uzbekistan),
"VA" => Some(Country::HolySee),
"VC" => Some(Country::SaintVincentAndGrenadines),
"VE" => Some(Country::VenezuelaBolivarianRepublic),
"VG" => Some(Country::VirginIslandsBritish),
"VI" => Some(Country::VirginIslandsUS),
"VN" => Some(Country::VietNam),
"VU" => Some(Country::Vanuatu),
"WF" => Some(Country::WallisAndFutuna),
"WS" => Some(Country::Samoa),
"YE" => Some(Country::Yemen),
"YT" => Some(Country::Mayotte),
"ZA" => Some(Country::SouthAfrica),
"ZM" => Some(Country::Zambia),
"ZW" => Some(Country::Zimbabwe),
"1A" => Some(Country::Kosovo),
"XI" => Some(Country::UnitedKingdomNorthernIreland),
_ => None,
}
}
}
#[cfg(feature = "iso_country")]
impl std::convert::TryFrom<Country> for iso_country::Country {
type Error = ErrFromCountryToIsoCountryCountry;
fn try_from(value: Country) -> Result<Self, Self::Error> {
match value {
Country::Andorra => Ok(iso_country::Country::AD),
Country::UnitedArabEmirates => Ok(iso_country::Country::AE),
Country::Afghanistan => Ok(iso_country::Country::AF),
Country::AntiguaAndBarbuda => Ok(iso_country::Country::AG),
Country::Anguilla => Ok(iso_country::Country::AI),
Country::Albania => Ok(iso_country::Country::AL),
Country::Armenia => Ok(iso_country::Country::AM),
Country::Angola => Ok(iso_country::Country::AO),
Country::Antarctica => Ok(iso_country::Country::AQ),
Country::Argentina => Ok(iso_country::Country::AR),
Country::AmericanSamoa => Ok(iso_country::Country::AS),
Country::Austria => Ok(iso_country::Country::AT),
Country::Australia => Ok(iso_country::Country::AU),
Country::Aruba => Ok(iso_country::Country::AW),
Country::ÅlandIslands => Ok(iso_country::Country::AX),
Country::Azerbaijan => Ok(iso_country::Country::AZ),
Country::BosniaAndHerzegovina => Ok(iso_country::Country::BA),
Country::Barbados => Ok(iso_country::Country::BB),
Country::Bangladesh => Ok(iso_country::Country::BD),
Country::Belgium => Ok(iso_country::Country::BE),
Country::BurkinaFaso => Ok(iso_country::Country::BF),
Country::Bulgaria => Ok(iso_country::Country::BG),
Country::Bahrain => Ok(iso_country::Country::BH),
Country::Burundi => Ok(iso_country::Country::BI),
Country::Benin => Ok(iso_country::Country::BJ),
Country::SaintBarthélemy => Ok(iso_country::Country::BL),
Country::Bermuda => Ok(iso_country::Country::BM),
Country::BruneiDarussalam => Ok(iso_country::Country::BN),
Country::BoliviaPlurinationalState => Ok(iso_country::Country::BO),
Country::BonaireSintEustatiusAndSaba => Ok(iso_country::Country::BQ),
Country::Brazil => Ok(iso_country::Country::BR),
Country::Bahamas => Ok(iso_country::Country::BS),
Country::Bhutan => Ok(iso_country::Country::BT),
Country::BouvetIsland => Ok(iso_country::Country::BV),
Country::Botswana => Ok(iso_country::Country::BW),
Country::Belarus => Ok(iso_country::Country::BY),
Country::Belize => Ok(iso_country::Country::BZ),
Country::Canada => Ok(iso_country::Country::CA),
Country::CocosKeelingIslands => Ok(iso_country::Country::CC),
Country::CongoDemocraticRepublic => Ok(iso_country::Country::CD),
Country::CentralAfricanRepublic => Ok(iso_country::Country::CF),
Country::Congo => Ok(iso_country::Country::CG),
Country::Switzerland => Ok(iso_country::Country::CH),
Country::CôteDivoire => Ok(iso_country::Country::CI),
Country::CookIslands => Ok(iso_country::Country::CK),
Country::Chile => Ok(iso_country::Country::CL),
Country::Cameroon => Ok(iso_country::Country::CM),
Country::China => Ok(iso_country::Country::CN),
Country::Colombia => Ok(iso_country::Country::CO),
Country::CostaRica => Ok(iso_country::Country::CR),
Country::Cuba => Ok(iso_country::Country::CU),
Country::CaboVerde => Ok(iso_country::Country::CV),
Country::Curaçao => Ok(iso_country::Country::CW),
Country::ChristmasIsland => Ok(iso_country::Country::CX),
Country::Cyprus => Ok(iso_country::Country::CY),
Country::Czechia => Ok(iso_country::Country::CZ),
Country::Germany => Ok(iso_country::Country::DE),
Country::Djibouti => Ok(iso_country::Country::DJ),
Country::Denmark => Ok(iso_country::Country::DK),
Country::Dominica => Ok(iso_country::Country::DM),
Country::DominicanRepublic => Ok(iso_country::Country::DO),
Country::Algeria => Ok(iso_country::Country::DZ),
Country::Ecuador => Ok(iso_country::Country::EC),
Country::Estonia => Ok(iso_country::Country::EE),
Country::Egypt => Ok(iso_country::Country::EG),
Country::WesternSahara => Ok(iso_country::Country::EH),
Country::Eritrea => Ok(iso_country::Country::ER),
Country::Spain => Ok(iso_country::Country::ES),
Country::Ethiopia => Ok(iso_country::Country::ET),
Country::Finland => Ok(iso_country::Country::FI),
Country::Fiji => Ok(iso_country::Country::FJ),
Country::FalklandIslandsMalvinas => Ok(iso_country::Country::FK),
Country::MicronesiaFederatedStates => Ok(iso_country::Country::FM),
Country::FaroeIslands => Ok(iso_country::Country::FO),
Country::France => Ok(iso_country::Country::FR),
Country::Gabon => Ok(iso_country::Country::GA),
Country::UnitedKingdomGreatBritainAndNorthernIreland => Ok(iso_country::Country::GB),
Country::Grenada => Ok(iso_country::Country::GD),
Country::Georgia => Ok(iso_country::Country::GE),
Country::FrenchGuiana => Ok(iso_country::Country::GF),
Country::Guernsey => Ok(iso_country::Country::GG),
Country::Ghana => Ok(iso_country::Country::GH),
Country::Gibraltar => Ok(iso_country::Country::GI),
Country::Greenland => Ok(iso_country::Country::GL),
Country::Gambia => Ok(iso_country::Country::GM),
Country::Guinea => Ok(iso_country::Country::GN),
Country::Guadeloupe => Ok(iso_country::Country::GP),
Country::EquatorialGuinea => Ok(iso_country::Country::GQ),
Country::Greece => Ok(iso_country::Country::GR),
Country::SouthGeorgiaAndSouthSandwichIslands => Ok(iso_country::Country::GS),
Country::Guatemala => Ok(iso_country::Country::GT),
Country::Guam => Ok(iso_country::Country::GU),
Country::GuineaBissau => Ok(iso_country::Country::GW),
Country::Guyana => Ok(iso_country::Country::GY),
Country::HongKong => Ok(iso_country::Country::HK),
Country::HeardIslandAndMcdonaldIslands => Ok(iso_country::Country::HM),
Country::Honduras => Ok(iso_country::Country::HN),
Country::Croatia => Ok(iso_country::Country::HR),
Country::Haiti => Ok(iso_country::Country::HT),
Country::Hungary => Ok(iso_country::Country::HU),
Country::Indonesia => Ok(iso_country::Country::ID),
Country::Ireland => Ok(iso_country::Country::IE),
Country::Israel => Ok(iso_country::Country::IL),
Country::IsleMan => Ok(iso_country::Country::IM),
Country::India => Ok(iso_country::Country::IN),
Country::BritishIndianOceanTerritory => Ok(iso_country::Country::IO),
Country::Iraq => Ok(iso_country::Country::IQ),
Country::IranIslamicRepublic => Ok(iso_country::Country::IR),
Country::Iceland => Ok(iso_country::Country::IS),
Country::Italy => Ok(iso_country::Country::IT),
Country::Jersey => Ok(iso_country::Country::JE),
Country::Jamaica => Ok(iso_country::Country::JM),
Country::Jordan => Ok(iso_country::Country::JO),
Country::Japan => Ok(iso_country::Country::JP),
Country::Kenya => Ok(iso_country::Country::KE),
Country::Kyrgyzstan => Ok(iso_country::Country::KG),
Country::Cambodia => Ok(iso_country::Country::KH),
Country::Kiribati => Ok(iso_country::Country::KI),
Country::Comoros => Ok(iso_country::Country::KM),
Country::SaintKittsAndNevis => Ok(iso_country::Country::KN),
Country::KoreaDemocraticPeoplesRepublic => Ok(iso_country::Country::KP),
Country::KoreaRepublic => Ok(iso_country::Country::KR),
Country::Kuwait => Ok(iso_country::Country::KW),
Country::CaymanIslands => Ok(iso_country::Country::KY),
Country::Kazakhstan => Ok(iso_country::Country::KZ),
Country::LaoPeoplesDemocraticRepublic => Ok(iso_country::Country::LA),
Country::Lebanon => Ok(iso_country::Country::LB),
Country::SaintLucia => Ok(iso_country::Country::LC),
Country::Liechtenstein => Ok(iso_country::Country::LI),
Country::SriLanka => Ok(iso_country::Country::LK),
Country::Liberia => Ok(iso_country::Country::LR),
Country::Lesotho => Ok(iso_country::Country::LS),
Country::Lithuania => Ok(iso_country::Country::LT),
Country::Luxembourg => Ok(iso_country::Country::LU),
Country::Latvia => Ok(iso_country::Country::LV),
Country::Libya => Ok(iso_country::Country::LY),
Country::Morocco => Ok(iso_country::Country::MA),
Country::Monaco => Ok(iso_country::Country::MC),
Country::MoldovaRepublic => Ok(iso_country::Country::MD),
Country::Montenegro => Ok(iso_country::Country::ME),
Country::SaintMartinFrenchPart => Ok(iso_country::Country::MF),
Country::Madagascar => Ok(iso_country::Country::MG),
Country::MarshallIslands => Ok(iso_country::Country::MH),
Country::NorthMacedonia => Ok(iso_country::Country::MK),
Country::Mali => Ok(iso_country::Country::ML),
Country::Myanmar => Ok(iso_country::Country::MM),
Country::Mongolia => Ok(iso_country::Country::MN),
Country::Macao => Ok(iso_country::Country::MO),
Country::NorthernMarianaIslands => Ok(iso_country::Country::MP),
Country::Martinique => Ok(iso_country::Country::MQ),
Country::Mauritania => Ok(iso_country::Country::MR),
Country::Montserrat => Ok(iso_country::Country::MS),
Country::Malta => Ok(iso_country::Country::MT),
Country::Mauritius => Ok(iso_country::Country::MU),
Country::Maldives => Ok(iso_country::Country::MV),
Country::Malawi => Ok(iso_country::Country::MW),
Country::Mexico => Ok(iso_country::Country::MX),
Country::Malaysia => Ok(iso_country::Country::MY),
Country::Mozambique => Ok(iso_country::Country::MZ),
Country::Namibia => Ok(iso_country::Country::NA),
Country::NewCaledonia => Ok(iso_country::Country::NC),
Country::Niger => Ok(iso_country::Country::NE),
Country::NorfolkIsland => Ok(iso_country::Country::NF),
Country::Nigeria => Ok(iso_country::Country::NG),
Country::Nicaragua => Ok(iso_country::Country::NI),
Country::Netherlands => Ok(iso_country::Country::NL),
Country::Norway => Ok(iso_country::Country::NO),
Country::Nepal => Ok(iso_country::Country::NP),
Country::Nauru => Ok(iso_country::Country::NR),
Country::Niue => Ok(iso_country::Country::NU),
Country::NewZealand => Ok(iso_country::Country::NZ),
Country::Oman => Ok(iso_country::Country::OM),
Country::Panama => Ok(iso_country::Country::PA),
Country::Peru => Ok(iso_country::Country::PE),
Country::FrenchPolynesia => Ok(iso_country::Country::PF),
Country::PapuaNewGuinea => Ok(iso_country::Country::PG),
Country::Philippines => Ok(iso_country::Country::PH),
Country::Pakistan => Ok(iso_country::Country::PK),
Country::Poland => Ok(iso_country::Country::PL),
Country::SaintPierreAndMiquelon => Ok(iso_country::Country::PM),
Country::Pitcairn => Ok(iso_country::Country::PN),
Country::PuertoRico => Ok(iso_country::Country::PR),
Country::PalestineState => Ok(iso_country::Country::PS),
Country::Portugal => Ok(iso_country::Country::PT),
Country::Palau => Ok(iso_country::Country::PW),
Country::Paraguay => Ok(iso_country::Country::PY),
Country::Qatar => Ok(iso_country::Country::QA),
Country::Réunion => Ok(iso_country::Country::RE),
Country::Romania => Ok(iso_country::Country::RO),
Country::Serbia => Ok(iso_country::Country::RS),
Country::RussianFederation => Ok(iso_country::Country::RU),
Country::Rwanda => Ok(iso_country::Country::RW),
Country::SaudiArabia => Ok(iso_country::Country::SA),
Country::SolomonIslands => Ok(iso_country::Country::SB),
Country::Seychelles => Ok(iso_country::Country::SC),
Country::Sudan => Ok(iso_country::Country::SD),
Country::Sweden => Ok(iso_country::Country::SE),
Country::Singapore => Ok(iso_country::Country::SG),
Country::SaintHelenaAscensionAndTristanDaCunha => Ok(iso_country::Country::SH),
Country::Slovenia => Ok(iso_country::Country::SI),
Country::SvalbardAndJanMayen => Ok(iso_country::Country::SJ),
Country::Slovakia => Ok(iso_country::Country::SK),
Country::SierraLeone => Ok(iso_country::Country::SL),
Country::SanMarino => Ok(iso_country::Country::SM),
Country::Senegal => Ok(iso_country::Country::SN),
Country::Somalia => Ok(iso_country::Country::SO),
Country::Suriname => Ok(iso_country::Country::SR),
Country::SouthSudan => Ok(iso_country::Country::SS),
Country::SaoTomeAndPrincipe => Ok(iso_country::Country::ST),
Country::ElSalvador => Ok(iso_country::Country::SV),
Country::SintMaartenDutchPart => Ok(iso_country::Country::SX),
Country::SyrianArabRepublic => Ok(iso_country::Country::SY),
Country::Eswatini => Ok(iso_country::Country::SZ),
Country::TurksAndCaicosIslands => Ok(iso_country::Country::TC),
Country::Chad => Ok(iso_country::Country::TD),
Country::FrenchSouthernTerritories => Ok(iso_country::Country::TF),
Country::Togo => Ok(iso_country::Country::TG),
Country::Thailand => Ok(iso_country::Country::TH),
Country::Tajikistan => Ok(iso_country::Country::TJ),
Country::Tokelau => Ok(iso_country::Country::TK),
Country::TimorLeste => Ok(iso_country::Country::TL),
Country::Turkmenistan => Ok(iso_country::Country::TM),
Country::Tunisia => Ok(iso_country::Country::TN),
Country::Tonga => Ok(iso_country::Country::TO),
Country::Türkiye => Ok(iso_country::Country::TR),
Country::TrinidadAndTobago => Ok(iso_country::Country::TT),
Country::Tuvalu => Ok(iso_country::Country::TV),
Country::TaiwanProvinceChina => Ok(iso_country::Country::TW),
Country::TanzaniaUnitedRepublic => Ok(iso_country::Country::TZ),
Country::Ukraine => Ok(iso_country::Country::UA),
Country::Uganda => Ok(iso_country::Country::UG),
Country::UnitedStatesMinorOutlyingIslands => Ok(iso_country::Country::UM),
Country::UnitedStatesAmerica => Ok(iso_country::Country::US),
Country::Uruguay => Ok(iso_country::Country::UY),
Country::Uzbekistan => Ok(iso_country::Country::UZ),
Country::HolySee => Ok(iso_country::Country::VA),
Country::SaintVincentAndGrenadines => Ok(iso_country::Country::VC),
Country::VenezuelaBolivarianRepublic => Ok(iso_country::Country::VE),
Country::VirginIslandsBritish => Ok(iso_country::Country::VG),
Country::VirginIslandsUS => Ok(iso_country::Country::VI),
Country::VietNam => Ok(iso_country::Country::VN),
Country::Vanuatu => Ok(iso_country::Country::VU),
Country::WallisAndFutuna => Ok(iso_country::Country::WF),
Country::Samoa => Ok(iso_country::Country::WS),
Country::Yemen => Ok(iso_country::Country::YE),
Country::Mayotte => Ok(iso_country::Country::YT),
Country::SouthAfrica => Ok(iso_country::Country::ZA),
Country::Zambia => Ok(iso_country::Country::ZM),
Country::Zimbabwe => Ok(iso_country::Country::ZW),
Country::Kosovo => Err(ErrFromCountryToIsoCountryCountry::Kosovo),
Country::UnitedKingdomNorthernIreland => {
Err(ErrFromCountryToIsoCountryCountry::UnitedKingdomNorthernIreland)
}
}
}
}
#[cfg(feature = "iso_country")]
#[derive(Debug, PartialEq, Eq, Hash)]
pub enum ErrFromCountryToIsoCountryCountry {
Kosovo,
UnitedKingdomNorthernIreland,
}
#[cfg(feature = "iso_country")]
impl std::fmt::Display for ErrFromCountryToIsoCountryCountry {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
ErrFromCountryToIsoCountryCountry::Kosovo => write!(
f,
"Kosovo has no corresponding value in iso_country::Country"
),
ErrFromCountryToIsoCountryCountry::UnitedKingdomNorthernIreland => write!(
f,
"UnitedKingdomNorthernIreland has no corresponding value in iso_country::Country"
),
}
}
}
#[cfg(feature = "iso_country")]
impl std::error::Error for ErrFromCountryToIsoCountryCountry {}
#[cfg(feature = "iso_country")]
impl std::convert::TryFrom<iso_country::Country> for Country {
type Error = ErrFromIsoCountryCountryToCountry;
fn try_from(value: iso_country::Country) -> Result<Country, Self::Error> {
match value {
iso_country::Country::AD => Ok(Country::Andorra),
iso_country::Country::AE => Ok(Country::UnitedArabEmirates),
iso_country::Country::AF => Ok(Country::Afghanistan),
iso_country::Country::AG => Ok(Country::AntiguaAndBarbuda),
iso_country::Country::AI => Ok(Country::Anguilla),
iso_country::Country::AL => Ok(Country::Albania),
iso_country::Country::AM => Ok(Country::Armenia),
iso_country::Country::AO => Ok(Country::Angola),
iso_country::Country::AQ => Ok(Country::Antarctica),
iso_country::Country::AR => Ok(Country::Argentina),
iso_country::Country::AS => Ok(Country::AmericanSamoa),
iso_country::Country::AT => Ok(Country::Austria),
iso_country::Country::AU => Ok(Country::Australia),
iso_country::Country::AW => Ok(Country::Aruba),
iso_country::Country::AX => Ok(Country::ÅlandIslands),
iso_country::Country::AZ => Ok(Country::Azerbaijan),
iso_country::Country::BA => Ok(Country::BosniaAndHerzegovina),
iso_country::Country::BB => Ok(Country::Barbados),
iso_country::Country::BD => Ok(Country::Bangladesh),
iso_country::Country::BE => Ok(Country::Belgium),
iso_country::Country::BF => Ok(Country::BurkinaFaso),
iso_country::Country::BG => Ok(Country::Bulgaria),
iso_country::Country::BH => Ok(Country::Bahrain),
iso_country::Country::BI => Ok(Country::Burundi),
iso_country::Country::BJ => Ok(Country::Benin),
iso_country::Country::BL => Ok(Country::SaintBarthélemy),
iso_country::Country::BM => Ok(Country::Bermuda),
iso_country::Country::BN => Ok(Country::BruneiDarussalam),
iso_country::Country::BO => Ok(Country::BoliviaPlurinationalState),
iso_country::Country::BQ => Ok(Country::BonaireSintEustatiusAndSaba),
iso_country::Country::BR => Ok(Country::Brazil),
iso_country::Country::BS => Ok(Country::Bahamas),
iso_country::Country::BT => Ok(Country::Bhutan),
iso_country::Country::BV => Ok(Country::BouvetIsland),
iso_country::Country::BW => Ok(Country::Botswana),
iso_country::Country::BY => Ok(Country::Belarus),
iso_country::Country::BZ => Ok(Country::Belize),
iso_country::Country::CA => Ok(Country::Canada),
iso_country::Country::CC => Ok(Country::CocosKeelingIslands),
iso_country::Country::CD => Ok(Country::CongoDemocraticRepublic),
iso_country::Country::CF => Ok(Country::CentralAfricanRepublic),
iso_country::Country::CG => Ok(Country::Congo),
iso_country::Country::CH => Ok(Country::Switzerland),
iso_country::Country::CI => Ok(Country::CôteDivoire),
iso_country::Country::CK => Ok(Country::CookIslands),
iso_country::Country::CL => Ok(Country::Chile),
iso_country::Country::CM => Ok(Country::Cameroon),
iso_country::Country::CN => Ok(Country::China),
iso_country::Country::CO => Ok(Country::Colombia),
iso_country::Country::CR => Ok(Country::CostaRica),
iso_country::Country::CU => Ok(Country::Cuba),
iso_country::Country::CV => Ok(Country::CaboVerde),
iso_country::Country::CW => Ok(Country::Curaçao),
iso_country::Country::CX => Ok(Country::ChristmasIsland),
iso_country::Country::CY => Ok(Country::Cyprus),
iso_country::Country::CZ => Ok(Country::Czechia),
iso_country::Country::DE => Ok(Country::Germany),
iso_country::Country::DJ => Ok(Country::Djibouti),
iso_country::Country::DK => Ok(Country::Denmark),
iso_country::Country::DM => Ok(Country::Dominica),
iso_country::Country::DO => Ok(Country::DominicanRepublic),
iso_country::Country::DZ => Ok(Country::Algeria),
iso_country::Country::EC => Ok(Country::Ecuador),
iso_country::Country::EE => Ok(Country::Estonia),
iso_country::Country::EG => Ok(Country::Egypt),
iso_country::Country::EH => Ok(Country::WesternSahara),
iso_country::Country::ER => Ok(Country::Eritrea),
iso_country::Country::ES => Ok(Country::Spain),
iso_country::Country::ET => Ok(Country::Ethiopia),
iso_country::Country::FI => Ok(Country::Finland),
iso_country::Country::FJ => Ok(Country::Fiji),
iso_country::Country::FK => Ok(Country::FalklandIslandsMalvinas),
iso_country::Country::FM => Ok(Country::MicronesiaFederatedStates),
iso_country::Country::FO => Ok(Country::FaroeIslands),
iso_country::Country::FR => Ok(Country::France),
iso_country::Country::GA => Ok(Country::Gabon),
iso_country::Country::GB => Ok(Country::UnitedKingdomGreatBritainAndNorthernIreland),
iso_country::Country::GD => Ok(Country::Grenada),
iso_country::Country::GE => Ok(Country::Georgia),
iso_country::Country::GF => Ok(Country::FrenchGuiana),
iso_country::Country::GG => Ok(Country::Guernsey),
iso_country::Country::GH => Ok(Country::Ghana),
iso_country::Country::GI => Ok(Country::Gibraltar),
iso_country::Country::GL => Ok(Country::Greenland),
iso_country::Country::GM => Ok(Country::Gambia),
iso_country::Country::GN => Ok(Country::Guinea),
iso_country::Country::GP => Ok(Country::Guadeloupe),
iso_country::Country::GQ => Ok(Country::EquatorialGuinea),
iso_country::Country::GR => Ok(Country::Greece),
iso_country::Country::GS => Ok(Country::SouthGeorgiaAndSouthSandwichIslands),
iso_country::Country::GT => Ok(Country::Guatemala),
iso_country::Country::GU => Ok(Country::Guam),
iso_country::Country::GW => Ok(Country::GuineaBissau),
iso_country::Country::GY => Ok(Country::Guyana),
iso_country::Country::HK => Ok(Country::HongKong),
iso_country::Country::HM => Ok(Country::HeardIslandAndMcdonaldIslands),
iso_country::Country::HN => Ok(Country::Honduras),
iso_country::Country::HR => Ok(Country::Croatia),
iso_country::Country::HT => Ok(Country::Haiti),
iso_country::Country::HU => Ok(Country::Hungary),
iso_country::Country::ID => Ok(Country::Indonesia),
iso_country::Country::IE => Ok(Country::Ireland),
iso_country::Country::IL => Ok(Country::Israel),
iso_country::Country::IM => Ok(Country::IsleMan),
iso_country::Country::IN => Ok(Country::India),
iso_country::Country::IO => Ok(Country::BritishIndianOceanTerritory),
iso_country::Country::IQ => Ok(Country::Iraq),
iso_country::Country::IR => Ok(Country::IranIslamicRepublic),
iso_country::Country::IS => Ok(Country::Iceland),
iso_country::Country::IT => Ok(Country::Italy),
iso_country::Country::JE => Ok(Country::Jersey),
iso_country::Country::JM => Ok(Country::Jamaica),
iso_country::Country::JO => Ok(Country::Jordan),
iso_country::Country::JP => Ok(Country::Japan),
iso_country::Country::KE => Ok(Country::Kenya),
iso_country::Country::KG => Ok(Country::Kyrgyzstan),
iso_country::Country::KH => Ok(Country::Cambodia),
iso_country::Country::KI => Ok(Country::Kiribati),
iso_country::Country::KM => Ok(Country::Comoros),
iso_country::Country::KN => Ok(Country::SaintKittsAndNevis),
iso_country::Country::KP => Ok(Country::KoreaDemocraticPeoplesRepublic),
iso_country::Country::KR => Ok(Country::KoreaRepublic),
iso_country::Country::KW => Ok(Country::Kuwait),
iso_country::Country::KY => Ok(Country::CaymanIslands),
iso_country::Country::KZ => Ok(Country::Kazakhstan),
iso_country::Country::LA => Ok(Country::LaoPeoplesDemocraticRepublic),
iso_country::Country::LB => Ok(Country::Lebanon),
iso_country::Country::LC => Ok(Country::SaintLucia),
iso_country::Country::LI => Ok(Country::Liechtenstein),
iso_country::Country::LK => Ok(Country::SriLanka),
iso_country::Country::LR => Ok(Country::Liberia),
iso_country::Country::LS => Ok(Country::Lesotho),
iso_country::Country::LT => Ok(Country::Lithuania),
iso_country::Country::LU => Ok(Country::Luxembourg),
iso_country::Country::LV => Ok(Country::Latvia),
iso_country::Country::LY => Ok(Country::Libya),
iso_country::Country::MA => Ok(Country::Morocco),
iso_country::Country::MC => Ok(Country::Monaco),
iso_country::Country::MD => Ok(Country::MoldovaRepublic),
iso_country::Country::ME => Ok(Country::Montenegro),
iso_country::Country::MF => Ok(Country::SaintMartinFrenchPart),
iso_country::Country::MG => Ok(Country::Madagascar),
iso_country::Country::MH => Ok(Country::MarshallIslands),
iso_country::Country::MK => Ok(Country::NorthMacedonia),
iso_country::Country::ML => Ok(Country::Mali),
iso_country::Country::MM => Ok(Country::Myanmar),
iso_country::Country::MN => Ok(Country::Mongolia),
iso_country::Country::MO => Ok(Country::Macao),
iso_country::Country::MP => Ok(Country::NorthernMarianaIslands),
iso_country::Country::MQ => Ok(Country::Martinique),
iso_country::Country::MR => Ok(Country::Mauritania),
iso_country::Country::MS => Ok(Country::Montserrat),
iso_country::Country::MT => Ok(Country::Malta),
iso_country::Country::MU => Ok(Country::Mauritius),
iso_country::Country::MV => Ok(Country::Maldives),
iso_country::Country::MW => Ok(Country::Malawi),
iso_country::Country::MX => Ok(Country::Mexico),
iso_country::Country::MY => Ok(Country::Malaysia),
iso_country::Country::MZ => Ok(Country::Mozambique),
iso_country::Country::NA => Ok(Country::Namibia),
iso_country::Country::NC => Ok(Country::NewCaledonia),
iso_country::Country::NE => Ok(Country::Niger),
iso_country::Country::NF => Ok(Country::NorfolkIsland),
iso_country::Country::NG => Ok(Country::Nigeria),
iso_country::Country::NI => Ok(Country::Nicaragua),
iso_country::Country::NL => Ok(Country::Netherlands),
iso_country::Country::NO => Ok(Country::Norway),
iso_country::Country::NP => Ok(Country::Nepal),
iso_country::Country::NR => Ok(Country::Nauru),
iso_country::Country::NU => Ok(Country::Niue),
iso_country::Country::NZ => Ok(Country::NewZealand),
iso_country::Country::OM => Ok(Country::Oman),
iso_country::Country::PA => Ok(Country::Panama),
iso_country::Country::PE => Ok(Country::Peru),
iso_country::Country::PF => Ok(Country::FrenchPolynesia),
iso_country::Country::PG => Ok(Country::PapuaNewGuinea),
iso_country::Country::PH => Ok(Country::Philippines),
iso_country::Country::PK => Ok(Country::Pakistan),
iso_country::Country::PL => Ok(Country::Poland),
iso_country::Country::PM => Ok(Country::SaintPierreAndMiquelon),
iso_country::Country::PN => Ok(Country::Pitcairn),
iso_country::Country::PR => Ok(Country::PuertoRico),
iso_country::Country::PS => Ok(Country::PalestineState),
iso_country::Country::PT => Ok(Country::Portugal),
iso_country::Country::PW => Ok(Country::Palau),
iso_country::Country::PY => Ok(Country::Paraguay),
iso_country::Country::QA => Ok(Country::Qatar),
iso_country::Country::RE => Ok(Country::Réunion),
iso_country::Country::RO => Ok(Country::Romania),
iso_country::Country::RS => Ok(Country::Serbia),
iso_country::Country::RU => Ok(Country::RussianFederation),
iso_country::Country::RW => Ok(Country::Rwanda),
iso_country::Country::SA => Ok(Country::SaudiArabia),
iso_country::Country::SB => Ok(Country::SolomonIslands),
iso_country::Country::SC => Ok(Country::Seychelles),
iso_country::Country::SD => Ok(Country::Sudan),
iso_country::Country::SE => Ok(Country::Sweden),
iso_country::Country::SG => Ok(Country::Singapore),
iso_country::Country::SH => Ok(Country::SaintHelenaAscensionAndTristanDaCunha),
iso_country::Country::SI => Ok(Country::Slovenia),
iso_country::Country::SJ => Ok(Country::SvalbardAndJanMayen),
iso_country::Country::SK => Ok(Country::Slovakia),
iso_country::Country::SL => Ok(Country::SierraLeone),
iso_country::Country::SM => Ok(Country::SanMarino),
iso_country::Country::SN => Ok(Country::Senegal),
iso_country::Country::SO => Ok(Country::Somalia),
iso_country::Country::SR => Ok(Country::Suriname),
iso_country::Country::SS => Ok(Country::SouthSudan),
iso_country::Country::ST => Ok(Country::SaoTomeAndPrincipe),
iso_country::Country::SV => Ok(Country::ElSalvador),
iso_country::Country::SX => Ok(Country::SintMaartenDutchPart),
iso_country::Country::SY => Ok(Country::SyrianArabRepublic),
iso_country::Country::SZ => Ok(Country::Eswatini),
iso_country::Country::TC => Ok(Country::TurksAndCaicosIslands),
iso_country::Country::TD => Ok(Country::Chad),
iso_country::Country::TF => Ok(Country::FrenchSouthernTerritories),
iso_country::Country::TG => Ok(Country::Togo),
iso_country::Country::TH => Ok(Country::Thailand),
iso_country::Country::TJ => Ok(Country::Tajikistan),
iso_country::Country::TK => Ok(Country::Tokelau),
iso_country::Country::TL => Ok(Country::TimorLeste),
iso_country::Country::TM => Ok(Country::Turkmenistan),
iso_country::Country::TN => Ok(Country::Tunisia),
iso_country::Country::TO => Ok(Country::Tonga),
iso_country::Country::TR => Ok(Country::Türkiye),
iso_country::Country::TT => Ok(Country::TrinidadAndTobago),
iso_country::Country::TV => Ok(Country::Tuvalu),
iso_country::Country::TW => Ok(Country::TaiwanProvinceChina),
iso_country::Country::TZ => Ok(Country::TanzaniaUnitedRepublic),
iso_country::Country::UA => Ok(Country::Ukraine),
iso_country::Country::UG => Ok(Country::Uganda),
iso_country::Country::UM => Ok(Country::UnitedStatesMinorOutlyingIslands),
iso_country::Country::US => Ok(Country::UnitedStatesAmerica),
iso_country::Country::UY => Ok(Country::Uruguay),
iso_country::Country::UZ => Ok(Country::Uzbekistan),
iso_country::Country::VA => Ok(Country::HolySee),
iso_country::Country::VC => Ok(Country::SaintVincentAndGrenadines),
iso_country::Country::VE => Ok(Country::VenezuelaBolivarianRepublic),
iso_country::Country::VG => Ok(Country::VirginIslandsBritish),
iso_country::Country::VI => Ok(Country::VirginIslandsUS),
iso_country::Country::VN => Ok(Country::VietNam),
iso_country::Country::VU => Ok(Country::Vanuatu),
iso_country::Country::WF => Ok(Country::WallisAndFutuna),
iso_country::Country::WS => Ok(Country::Samoa),
iso_country::Country::YE => Ok(Country::Yemen),
iso_country::Country::YT => Ok(Country::Mayotte),
iso_country::Country::ZA => Ok(Country::SouthAfrica),
iso_country::Country::ZM => Ok(Country::Zambia),
iso_country::Country::ZW => Ok(Country::Zimbabwe),
iso_country::Country::Unspecified => {
Err(ErrFromIsoCountryCountryToCountry::Unspecified)
}
}
}
}
#[cfg(feature = "iso_country")]
#[derive(Debug, PartialEq, Eq, Hash)]
pub enum ErrFromIsoCountryCountryToCountry {
Unspecified,
}
#[cfg(feature = "iso_country")]
impl std::fmt::Display for ErrFromIsoCountryCountryToCountry {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
ErrFromIsoCountryCountryToCountry::Unspecified => {
write!(f, "Unspecified has no corresponding value in Country")
}
}
}
}
#[cfg(feature = "iso_country")]
impl std::error::Error for ErrFromIsoCountryCountryToCountry {}