pub enum CurrencyCode {
Show 152 variants AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STD, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW,
}
Expand description

An enum containing currency codes.

§Example

use keshvar::{CurrencyCode, Alpha2};

assert_eq!(Ok(CurrencyCode::QAR), CurrencyCode::try_from("qAr")); // not case-sensitive
let eur_alpha2_country_list: Vec<Alpha2> = CurrencyCode::EUR
    .alpha2_list()
    .iter()
    .filter_map(|alpha2_str| Alpha2::try_from(*alpha2_str).ok())
    .collect();
assert!(eur_alpha2_country_list.contains(&Alpha2::ES)); // Spain
assert!(eur_alpha2_country_list.contains(&Alpha2::NL)); // Netherlands

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

Variants§

§

AED

  • The United Arab Emirates (Asia)
§

AFN

  • The Islamic Republic of Afghanistan (Asia)
§

ALL

  • The Republic of Albania (Europe)
§

AMD

  • The Republic of Armenia (Asia)
§

ANG

  • The Country of Curaçao (Americas)
  • Sint Maarten (Americas)
§

AOA

  • The Republic of Angola (Africa)
§

ARS

  • The Argentine Republic (Americas)
§

AUD

  • The Commonwealth of Australia (Oceania)
  • The Territory of Cocos (Keeling) Islands (Oceania)
  • The Territory of Christmas Island (Oceania)
  • The Territory of Heard Island and McDonald Islands
  • The Republic of Kiribati (Oceania)
  • The Territory of Norfolk Island (Oceania)
  • The Republic of Nauru (Oceania)
  • Tuvalu (Oceania)
§

AWG

  • Aruba (Americas)
§

AZN

  • The Republic of Azerbaijan (Asia)
§

BAM

  • Bosnia and Herzegovina (Europe)
§

BBD

  • Barbados (Americas)
§

BDT

  • The People’s Republic of Bangladesh (Asia)
§

BGN

  • The Republic of Bulgaria (Europe)
§

BHD

  • The Kingdom of Bahrain (Asia)
§

BIF

  • The Republic of Burundi (Africa)
§

BMD

  • Bermuda (Americas)
§

BND

  • The Nation of Brunei, the Abode of Peace (Asia)
§

BOB

  • The Plurinational State of Bolivia (Americas)
§

BRL

  • The Federative Republic of Brazil (Americas)
§

BSD

  • The Commonwealth of The Bahamas (Americas)
§

BTN

  • The Kingdom of Bhutan (Asia)
§

BWP

  • The Republic of Botswana (Africa)
§

BYN

  • The Republic of Belarus (Europe)
§

BZD

  • Belize (Americas)
§

CAD

  • Canada (Americas)
§

CDF

  • The Democratic Republic of the Congo (Africa)
§

CHF

  • The Swiss Confederation (Europe)
  • The Principality of Liechtenstein (Europe)
§

CLP

  • The Republic of Chile (Americas)
§

CNY

  • The People’s Republic of China (Asia)
§

COP

  • The Republic of Colombia (Americas)
§

CRC

  • The Republic of Costa Rica (Americas)
§

CUP

  • The Republic of Cuba (Americas)
§

CVE

  • The Republic of Cabo Verde (Africa)
§

CZK

  • The Czech Republic (Europe)
§

DJF

  • The Republic of Djibouti (Africa)
§

DKK

  • The Kingdom of Denmark (Europe)
  • The Faroe Islands (Europe)
  • Kalaallit Nunaat (Americas)
§

DOP

  • The Dominican Republic (Americas)
§

DZD

  • The People’s Democratic Republic of Algeria (Africa)
§

EGP

  • The Arab Republic of Egypt (Africa)
§

ETB

  • The State of Eritrea (Africa)
  • The Federal Democratic Republic of Ethiopia (Africa)
§

EUR

  • The Principality of Andorra (Europe)
  • The Republic of Austria (Europe)
  • Åland (Europe)
  • The Kingdom of Belgium (Europe)
  • The Collectivity of Saint-Barthélemy (Americas)
  • The Republic of Cyprus (Asia)
  • The Federal Republic of Germany (Europe)
  • The Republic of Estonia (Europe)
  • The Kingdom of Spain (Europe)
  • The Republic of Finland (Europe)
  • The French Republic (Europe)
  • Guyane (Americas)
  • Guadeloupe (Americas)
  • The Hellenic Republic (Europe)
  • The Republic of Croatia (Europe)
  • Ireland (Europe)
  • The Italian Republic (Europe)
  • The Republic of Lithuania (Europe)
  • The Grand Duchy of Luxembourg (Europe)
  • The Republic of Latvia (Europe)
  • The Principality of Monaco (Europe)
  • Montenegro (Europe)
  • The Collectivity of Saint-Martin (Americas)
  • Martinique (Americas)
  • The Republic of Malta (Europe)
  • The Kingdom of the Netherlands (Europe)
  • The Overseas Collectivity of Saint-Pierre and Miquelon (Americas)
  • The Portuguese Republic (Europe)
  • Réunion (Africa)
  • The Republic of Slovenia (Europe)
  • The Slovak Republic (Europe)
  • The Republic of San Marino (Europe)
  • The French Southern and Antarctic Lands (Africa)
  • The Holy See (Europe)
  • The Department of Mayotte (Africa)
§

FJD

  • The Republic of Fiji (Oceania)
§

FKP

  • The Falkland Islands (Americas)
§

GBP

  • The United Kingdom of Great Britain and Northern Ireland (Europe)
  • The Bailiwick of Guernsey (Europe)
  • South Georgia and the South Sandwich Islands (Americas)
  • The Isle of Man (Europe)
  • The Bailiwick of Jersey (Europe)
§

GEL

  • Georgia (Asia)
§

GHS

  • The Republic of Ghana (Africa)
§

GIP

  • Gibraltar (Europe)
§

GMD

  • The Republic of The Gambia (Africa)
§

GNF

  • The Republic of Guinea (Africa)
§

GTQ

  • The Republic of Guatemala (Americas)
§

GYD

  • The Co-operative Republic of Guyana (Americas)
§

HKD

  • The Hong Kong Special Administrative Region of China (Asia)
§

HNL

  • The Republic of Honduras (Americas)
§

HTG

  • The Republic of Haiti (Americas)
§

HUF

  • Hungary (Europe)
§

IDR

  • The Republic of Indonesia (Asia)
  • The Democratic Republic of Timor-Leste (Asia)
§

ILS

  • The State of Israel (Asia)
  • The State of Palestine (Asia)
§

INR

  • The Republic of India (Asia)
§

IQD

  • The Republic of Iraq (Asia)
§

IRR

  • The Islamic Republic of Iran (Asia)
§

ISK

  • Iceland (Europe)
§

JMD

  • Jamaica (Americas)
§

JOD

  • The Hashemite Kingdom of Jordan (Asia)
§

JPY

  • Japan (Asia)
§

KES

  • The Republic of Kenya (Africa)
§

KGS

  • The Kyrgyz Republic (Asia)
§

KHR

  • The Kingdom of Cambodia (Asia)
§

KMF

  • The Union of the Comoros (Africa)
§

KPW

  • The Democratic People’s Republic of Korea (Asia)
§

KRW

  • The Republic of Korea (Asia)
§

KWD

  • The State of Kuwait (Asia)
§

KYD

  • The Cayman Islands (Americas)
§

KZT

  • The Republic of Kazakhstan (Asia)
§

LAK

  • The Lao People’s Democratic Republic (Asia)
§

LBP

  • The Lebanese Republic (Asia)
§

LKR

  • The Democratic Socialist Republic of Sri Lanka (Asia)
§

LRD

  • The Republic of Liberia (Africa)
§

LSL

  • The Kingdom of Lesotho (Africa)
§

LYD

  • The State of Libya (Africa)
§

MAD

  • The Sahrawi Arab Democratic Republic (Africa)
  • The Kingdom of Morocco (Africa)
§

MDL

  • The Republic of Moldova (Europe)
§

MGA

  • The Republic of Madagascar (Africa)
§

MKD

  • The Republic of North Macedonia (Europe)
§

MMK

  • The Republic of the Union of Myanmar (Asia)
§

MNT

  • Mongolia (Asia)
§

MOP

  • The Macao Special Administrative Region of China (Asia)
§

MRU

  • The Islamic Republic of Mauritania (Africa)
§

MUR

  • The Republic of Mauritius (Africa)
§

MVR

  • The Republic of Maldives (Asia)
§

MWK

  • The Republic of Malawi (Africa)
§

MXN

  • The United Mexican States (Americas)
§

MYR

  • Malaysia (Asia)
§

MZN

  • The Republic of Mozambique (Africa)
§

NAD

  • The Republic of Namibia (Africa)
§

NGN

  • The Federal Republic of Nigeria (Africa)
§

NIO

  • The Republic of Nicaragua (Americas)
§

NOK

  • Bouvet Island
  • The Kingdom of Norway (Europe)
  • Svalbard and Jan Mayen (Europe)
§

NPR

  • The Federal Democratic Republic of Nepal (Asia)
§

NZD

  • The Cook Islands (Oceania)
  • Niue (Oceania)
  • New Zealand (Oceania)
  • The Pitcairn, Henderson, Ducie and Oeno Islands (Oceania)
  • Tokelau (Oceania)
§

OMR

  • The Sultanate of Oman (Asia)
§

PAB

  • The Republic of Panamá (Americas)
§

PEN

  • The Republic of Perú (Americas)
§

PGK

  • The Independent State of Papua New Guinea (Oceania)
§

PHP

  • The Republic of the Philippines (Asia)
§

PKR

  • The Islamic Republic of Pakistan (Asia)
§

PLN

  • The Republic of Poland (Europe)
§

PYG

  • The Republic of Paraguay (Americas)
§

QAR

  • The State of Qatar (Asia)
§

RON

  • Romania (Europe)
§

RSD

  • The Republic of Serbia (Europe)
§

RUB

  • The Russian Federation (Europe)
§

RWF

  • The Republic of Rwanda (Africa)
§

SAR

  • The Kingdom of Saudi Arabia (Asia)
§

SBD

  • The Solomon Islands (Oceania)
§

SCR

  • The Republic of Seychelles (Africa)
§

SDG

  • The Republic of the Sudan (Africa)
§

SEK

  • The Kingdom of Sweden (Europe)
§

SGD

  • The Republic of Singapore (Asia)
§

SHP

  • Saint Helena, Ascension and Tristan da Cunha (Africa)
§

SLL

  • The Republic of Sierra Leone (Africa)
§

SOS

  • The Federal Republic of Somalia (Africa)
§

SRD

  • The Republic of Suriname (Americas)
§

SSP

  • The Republic of South Sudan (Africa)
§

STD

  • The Democratic Republic of São Tomé and Príncipe (Africa)
§

SYP

  • The Syrian Arab Republic (Asia)
§

SZL

  • The Kingdom of Eswatini (Africa)
§

THB

  • The Kingdom of Thailand (Asia)
§

TJS

  • The Republic of Tajikistan (Asia)
§

TMT

  • Turkmenistan (Asia)
§

TND

  • The Republic of Tunisia (Africa)
§

TOP

  • The Kingdom of Tonga (Oceania)
§

TRY

  • The Republic of Türkiye (Asia)
§

TTD

  • The Republic of Trinidad and Tobago (Americas)
§

TWD

  • Taiwan, Province of China (Asia)
§

TZS

  • The United Republic of Tanzania (Africa)
§

UAH

  • Ukraine (Europe)
§

UGX

  • The Republic of Uganda (Africa)
§

USD

  • Antarctica
  • The Territory of American Samoa (Oceania)
  • Bonaire, Sint Eustatius and Saba (Americas)
  • The Republic of Ecuador (Americas)
  • The Federated States of Micronesia (Oceania)
  • The Territory of Guam (Oceania)
  • The British Indian Ocean Territory (Africa)
  • The Republic of the Marshall Islands (Oceania)
  • The Commonwealth of the Northern Mariana Islands (Oceania)
  • The Commonwealth of Puerto Rico (Americas)
  • The Republic of Palau (Oceania)
  • The Republic of El Salvador (Americas)
  • The Turks and Caicos Islands (Americas)
  • United States Minor Outlying Islands (Americas)
  • The United States of America (Americas)
  • The Virgin Islands (Americas)
  • The Virgin Islands of the United States (Americas)
  • The Republic of Zimbabwe (Africa)
§

UYU

  • The Oriental Republic of Uruguay (Americas)
§

UZS

  • The Republic of Uzbekistan (Asia)
§

VES

  • The Bolivarian Republic of Venezuela (Americas)
§

VND

  • The Socialist Republic of Viet Nam (Asia)
§

VUV

  • The Republic of Vanuatu (Oceania)
§

WST

  • The Independent State of Samoa (Oceania)
§

XAF

  • The Central African Republic (Africa)
  • The Republic of the Congo (Africa)
  • The Republic of Cameroon (Africa)
  • The Gabonese Republic (Africa)
  • The Republic of Equatorial Guinea (Africa)
  • The Republic of Chad (Africa)
§

XCD

  • Antigua and Barbuda (Americas)
  • Anguilla (Americas)
  • The Commonwealth of Dominica (Americas)
  • Grenada (Americas)
  • Saint Kitts and Nevis (Americas)
  • Saint Lucia (Americas)
  • Montserrat (Americas)
  • Saint Vincent and the Grenadines (Americas)
§

XOF

  • Burkina Faso (Africa)
  • The Republic of Benin (Africa)
  • The Republic of Côte d’Ivoire (Africa)
  • The Republic of Guinea-Bissau (Africa)
  • The Republic of Mali (Africa)
  • The Republic of the Niger (Africa)
  • The Republic of Senegal (Africa)
  • The Togolese Republic (Africa)
§

XPF

  • New Caledonia (Oceania)
  • French Polynesia (Oceania)
  • The Territory of the Wallis and Futuna Islands (Oceania)
§

YER

  • The Republic of Yemen (Asia)
§

ZAR

  • The Republic of South Africa (Africa)
§

ZMW

  • The Republic of Zambia (Africa)

Implementations§

source§

impl CurrencyCode

source

pub fn alpha2_list(&self) -> &[&str]

source§

impl CurrencyCode

source

pub fn to_iso_currency(&self) -> Currency

If iso-currency-integration feature is enabled, you can convert it to iso_currency::Currency enum. Note that CurrencyCode::STD is not supported by iso_currency library.

Trait Implementations§

source§

impl Clone for CurrencyCode

source§

fn clone(&self) -> CurrencyCode

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 CurrencyCode

source§

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

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

impl<'de> Deserialize<'de> for CurrencyCode

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 CurrencyCode

source§

fn eq(&self, other: &CurrencyCode) -> 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 CurrencyCode

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 CurrencyCode

source§

fn to_string(&self) -> String

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

impl TryFrom<&str> for CurrencyCode

§

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 CurrencyCode

source§

impl StructuralPartialEq for CurrencyCode

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