Skip to main content

InstrumentName

Enum InstrumentName 

Source
#[non_exhaustive]
pub enum InstrumentName {
Show 124 variants Au200Aud, AudCad, AudChf, AudHkd, AudJpy, AudNzd, AudSgd, AudUsd, BcoUsd, CadChf, CadHkd, CadJpy, CadSgd, Ch20Chf, ChfHkd, ChfJpy, ChfZar, ChinahHkd, Cn50Usd, CornUsd, De10YbEur, De30Eur, EspixEur, Eu50Eur, EurAud, EurCad, EurChf, EurCzk, EurDkk, EurGbp, EurHkd, EurHuf, EurJpy, EurNok, EurNzd, EurPln, EurSek, EurSgd, EurTry, EurUsd, EurZar, Fr40Eur, GbpAud, GbpCad, GbpChf, GbpHkd, GbpJpy, GbpNzd, GbpPln, GbpSgd, GbpUsd, GbpZar, Hk33Hkd, HkdJpy, Jp225YJpy, Jp225Usd, Nas100Usd, NatgasUsd, Nl25Eur, NzdCad, NzdChf, NzdHkd, NzdJpy, NzdSgd, NzdUsd, Sg30Sgd, SgdChf, SgdJpy, SoybnUsd, Spx500Usd, SugarUsd, TryJpy, Uk100Gbp, Uk10YbGbp, Us2000Usd, Us30Usd, Usb02YUsd, Usb05YUsd, Usb10YUsd, Usb30YUsd, UsdCad, UsdChf, UsdCnh, UsdCzk, UsdDkk, UsdHkd, UsdHuf, UsdJpy, UsdMxn, UsdNok, UsdPln, UsdSek, UsdSgd, UsdThb, UsdTry, UsdZar, WheatUsd, WticoUsd, XagAud, XagCad, XagChf, XagEur, XagGbp, XagHkd, XagJpy, XagNzd, XagSgd, XagUsd, XauAud, XauCad, XauChf, XauEur, XauGbp, XauHkd, XauJpy, XauNzd, XauSgd, XauUsd, XauXag, XcuUsd, XpdUsd, XptUsd, ZarJpy, Other(String),
}
Expand description

The name of an instrument (symbol) in BASE_QUOTE format.

All symbols available on OANDA’s fxPractice environment are represented as dedicated variants; anything else (new listings, division-specific CFDs) round-trips through InstrumentName::Other, so parsing and deserialization never fail. Known strings always normalize to their variant: InstrumentName::from("EUR_USD") == InstrumentName::EurUsd.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Au200Aud

Australia 200 (AU200_AUD, cfd)

§

AudCad

AUD/CAD (AUD_CAD, currency)

§

AudChf

AUD/CHF (AUD_CHF, currency)

§

AudHkd

AUD/HKD (AUD_HKD, currency)

§

AudJpy

AUD/JPY (AUD_JPY, currency)

§

AudNzd

AUD/NZD (AUD_NZD, currency)

§

AudSgd

AUD/SGD (AUD_SGD, currency)

§

AudUsd

AUD/USD (AUD_USD, currency)

§

BcoUsd

Brent Crude Oil (BCO_USD, cfd)

§

CadChf

CAD/CHF (CAD_CHF, currency)

§

CadHkd

CAD/HKD (CAD_HKD, currency)

§

CadJpy

CAD/JPY (CAD_JPY, currency)

§

CadSgd

CAD/SGD (CAD_SGD, currency)

§

Ch20Chf

Switzerland 20 (CH20_CHF, cfd)

§

ChfHkd

CHF/HKD (CHF_HKD, currency)

§

ChfJpy

CHF/JPY (CHF_JPY, currency)

§

ChfZar

CHF/ZAR (CHF_ZAR, currency)

§

ChinahHkd

China H Shares (CHINAH_HKD, cfd)

§

Cn50Usd

China A50 (CN50_USD, cfd)

§

CornUsd

Corn (CORN_USD, cfd)

§

De10YbEur

Bund (DE10YB_EUR, cfd)

§

De30Eur

Germany 30 (DE30_EUR, cfd)

§

EspixEur

Spain 35 (ESPIX_EUR, cfd)

§

Eu50Eur

Europe 50 (EU50_EUR, cfd)

§

EurAud

EUR/AUD (EUR_AUD, currency)

§

EurCad

EUR/CAD (EUR_CAD, currency)

§

EurChf

EUR/CHF (EUR_CHF, currency)

§

EurCzk

EUR/CZK (EUR_CZK, currency)

§

EurDkk

EUR/DKK (EUR_DKK, currency)

§

EurGbp

EUR/GBP (EUR_GBP, currency)

§

EurHkd

EUR/HKD (EUR_HKD, currency)

§

EurHuf

EUR/HUF (EUR_HUF, currency)

§

EurJpy

EUR/JPY (EUR_JPY, currency)

§

EurNok

EUR/NOK (EUR_NOK, currency)

§

EurNzd

EUR/NZD (EUR_NZD, currency)

§

EurPln

EUR/PLN (EUR_PLN, currency)

§

EurSek

EUR/SEK (EUR_SEK, currency)

§

EurSgd

EUR/SGD (EUR_SGD, currency)

§

EurTry

EUR/TRY (EUR_TRY, currency)

§

EurUsd

EUR/USD (EUR_USD, currency)

§

EurZar

EUR/ZAR (EUR_ZAR, currency)

§

Fr40Eur

France 40 (FR40_EUR, cfd)

§

GbpAud

GBP/AUD (GBP_AUD, currency)

§

GbpCad

GBP/CAD (GBP_CAD, currency)

§

GbpChf

GBP/CHF (GBP_CHF, currency)

§

GbpHkd

GBP/HKD (GBP_HKD, currency)

§

GbpJpy

GBP/JPY (GBP_JPY, currency)

§

GbpNzd

GBP/NZD (GBP_NZD, currency)

§

GbpPln

GBP/PLN (GBP_PLN, currency)

§

GbpSgd

GBP/SGD (GBP_SGD, currency)

§

GbpUsd

GBP/USD (GBP_USD, currency)

§

GbpZar

GBP/ZAR (GBP_ZAR, currency)

§

Hk33Hkd

Hong Kong 33 (HK33_HKD, cfd)

§

HkdJpy

HKD/JPY (HKD_JPY, currency)

§

Jp225YJpy

Japan 225 (JPY) (JP225Y_JPY, cfd)

§

Jp225Usd

Japan 225 (JP225_USD, cfd)

§

Nas100Usd

US Nas 100 (NAS100_USD, cfd)

§

NatgasUsd

Natural Gas (NATGAS_USD, cfd)

§

Nl25Eur

Netherlands 25 (NL25_EUR, cfd)

§

NzdCad

NZD/CAD (NZD_CAD, currency)

§

NzdChf

NZD/CHF (NZD_CHF, currency)

§

NzdHkd

NZD/HKD (NZD_HKD, currency)

§

NzdJpy

NZD/JPY (NZD_JPY, currency)

§

NzdSgd

NZD/SGD (NZD_SGD, currency)

§

NzdUsd

NZD/USD (NZD_USD, currency)

§

Sg30Sgd

Singapore 30 (SG30_SGD, cfd)

§

SgdChf

SGD/CHF (SGD_CHF, currency)

§

SgdJpy

SGD/JPY (SGD_JPY, currency)

§

SoybnUsd

Soybeans (SOYBN_USD, cfd)

§

Spx500Usd

US SPX 500 (SPX500_USD, cfd)

§

SugarUsd

Sugar (SUGAR_USD, cfd)

§

TryJpy

TRY/JPY (TRY_JPY, currency)

§

Uk100Gbp

UK 100 (UK100_GBP, cfd)

§

Uk10YbGbp

UK 10Y Gilt (UK10YB_GBP, cfd)

§

Us2000Usd

US Russ 2000 (US2000_USD, cfd)

§

Us30Usd

US Wall St 30 (US30_USD, cfd)

§

Usb02YUsd

US 2Y T-Note (USB02Y_USD, cfd)

§

Usb05YUsd

US 5Y T-Note (USB05Y_USD, cfd)

§

Usb10YUsd

US 10Y T-Note (USB10Y_USD, cfd)

§

Usb30YUsd

US T-Bond (USB30Y_USD, cfd)

§

UsdCad

USD/CAD (USD_CAD, currency)

§

UsdChf

USD/CHF (USD_CHF, currency)

§

UsdCnh

USD/CNH (USD_CNH, currency)

§

UsdCzk

USD/CZK (USD_CZK, currency)

§

UsdDkk

USD/DKK (USD_DKK, currency)

§

UsdHkd

USD/HKD (USD_HKD, currency)

§

UsdHuf

USD/HUF (USD_HUF, currency)

§

UsdJpy

USD/JPY (USD_JPY, currency)

§

UsdMxn

USD/MXN (USD_MXN, currency)

§

UsdNok

USD/NOK (USD_NOK, currency)

§

UsdPln

USD/PLN (USD_PLN, currency)

§

UsdSek

USD/SEK (USD_SEK, currency)

§

UsdSgd

USD/SGD (USD_SGD, currency)

§

UsdThb

USD/THB (USD_THB, currency)

§

UsdTry

USD/TRY (USD_TRY, currency)

§

UsdZar

USD/ZAR (USD_ZAR, currency)

§

WheatUsd

Wheat (WHEAT_USD, cfd)

§

WticoUsd

West Texas Oil (WTICO_USD, cfd)

§

XagAud

Silver/AUD (XAG_AUD, metal)

§

XagCad

Silver/CAD (XAG_CAD, metal)

§

XagChf

Silver/CHF (XAG_CHF, metal)

§

XagEur

Silver/EUR (XAG_EUR, metal)

§

XagGbp

Silver/GBP (XAG_GBP, metal)

§

XagHkd

Silver/HKD (XAG_HKD, metal)

§

XagJpy

Silver/JPY (XAG_JPY, metal)

§

XagNzd

Silver/NZD (XAG_NZD, metal)

§

XagSgd

Silver/SGD (XAG_SGD, metal)

§

XagUsd

Silver (XAG_USD, metal)

§

XauAud

Gold/AUD (XAU_AUD, metal)

§

XauCad

Gold/CAD (XAU_CAD, metal)

§

XauChf

Gold/CHF (XAU_CHF, metal)

§

XauEur

Gold/EUR (XAU_EUR, metal)

§

XauGbp

Gold/GBP (XAU_GBP, metal)

§

XauHkd

Gold/HKD (XAU_HKD, metal)

§

XauJpy

Gold/JPY (XAU_JPY, metal)

§

XauNzd

Gold/NZD (XAU_NZD, metal)

§

XauSgd

Gold/SGD (XAU_SGD, metal)

§

XauUsd

Gold (XAU_USD, metal)

§

XauXag

Gold/Silver (XAU_XAG, metal)

§

XcuUsd

Copper (XCU_USD, cfd)

§

XpdUsd

Palladium (XPD_USD, cfd)

§

XptUsd

Platinum (XPT_USD, cfd)

§

ZarJpy

ZAR/JPY (ZAR_JPY, currency)

§

Other(String)

An instrument not (yet) in the known symbol table.

Implementations§

Source§

impl InstrumentName

Source

pub const KNOWN: &'static [InstrumentName]

Every known instrument, in alphabetical order.

Source

pub fn as_str(&self) -> &str

The canonical wire representation, e.g. EUR_USD.

Source

pub fn is_known(&self) -> bool

Whether this is a known symbol (i.e. not InstrumentName::Other).

Trait Implementations§

Source§

impl Clone for InstrumentName

Source§

fn clone(&self) -> InstrumentName

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InstrumentName

Source§

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

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

impl<'de> Deserialize<'de> for InstrumentName

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for InstrumentName

Source§

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

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

impl Eq for InstrumentName

Source§

impl From<&str> for InstrumentName

Source§

fn from(value: &str) -> Self

Converts to this type from the input type.
Source§

impl From<String> for InstrumentName

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl FromStr for InstrumentName

Source§

type Err = Infallible

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for InstrumentName

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for InstrumentName

Source§

fn cmp(&self, other: &InstrumentName) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for InstrumentName

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialOrd for InstrumentName

Source§

fn partial_cmp(&self, other: &InstrumentName) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for InstrumentName

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for InstrumentName

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more