Skip to main content

FixingSource

Enum FixingSource 

pub enum FixingSource {
    Single(String),
    Cross {
        reference: String,
        settlement: String,
    },
}
Expand description

Where a cash settlement’s fixing comes from: one FX series, or the cross of two series through USD — EMTA’s Cross Currency Settlement Rate, the reference currency’s rate crossed with the settlement currency’s, both for the one valuation date.

Variants§

§

Single(String)

The pair’s canonical FX key (FX-USDKRW).

§

Cross

Two canonical keys against USD: the reference currency’s (FX-USDKRW) and the settlement currency’s (FX-EURUSD). It fixes reference units per one settlement unit.

Fields

§reference: String

The reference currency’s key against USD.

§settlement: String

The settlement currency’s key against USD.

Implementations§

§

impl FixingSource

pub fn cross( reference: impl Into<String>, settlement: impl Into<String>, ) -> Result<Self, FixingSourceError>

The cross of reference’s and settlement’s keys against USD.

§Errors

FixingSourceError when a key is not an FX key against USD, or both name one currency.

pub fn usd_key(currency: &str) -> String

A currency’s FX key against USD as the market quotes it: EUR, GBP, AUD and NZD are priced in USD per unit (FX-EURUSD), every other currency in units per USD (FX-USDJPY, FX-USDKRW).

pub fn keys(&self) -> Vec<&str>

The series this source reads, in order.

pub fn currencies(&self) -> Option<(&str, &str)>

The two currency codes the fixing is between, (settlement, reference) as it quotes: a single key’s base and quote; a cross’s settlement key’s non-USD currency and its reference key’s. None for a key that is not FX- followed by two three-letter codes.

Trait Implementations§

§

impl Clone for FixingSource

§

fn clone(&self) -> FixingSource

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
§

impl Debug for FixingSource

§

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

Formats the value using the given formatter. Read more
§

impl Display for FixingSource

§

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

Formats the value using the given formatter. Read more
§

impl Eq for FixingSource

§

impl From<&String> for FixingSource

§

fn from(key: &String) -> Self

Converts to this type from the input type.
§

impl From<&str> for FixingSource

§

fn from(key: &str) -> Self

Converts to this type from the input type.
§

impl From<String> for FixingSource

§

fn from(key: String) -> Self

Converts to this type from the input type.
§

impl Hash for FixingSource

§

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
§

impl PartialEq for FixingSource

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

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

impl StructuralPartialEq for FixingSource

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

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.