[][src]Struct commodity::CurrencyCode

pub struct CurrencyCode { /* fields omitted */ }

The code/id of a Currency.

Methods

impl CurrencyCode[src]

pub fn new(code_array: ArrayString<[u8; 8]>) -> CurrencyCode[src]

Create a new CurrencyCode.

Trait Implementations

impl Clone for CurrencyCode[src]

impl Copy for CurrencyCode[src]

impl Debug for CurrencyCode[src]

impl<'de> Deserialize<'de> for CurrencyCode[src]

impl Display for CurrencyCode[src]

impl Eq for CurrencyCode[src]

impl<'_> From<&'_ Currency> for CurrencyCode[src]

impl FromStr for CurrencyCode[src]

type Err = CommodityError

The associated error which can be returned from parsing.

fn from_str(code: &str) -> Result<CurrencyCode, CommodityError>[src]

Create a new Currency.

code is an array backed string that has a fixed maximum size of CURRENCY_CODE_LENGTH. The supplied string must not exeed this, or a CommodityError::TooLongCurrencyCode will be returned.

Example

use std::str::FromStr;
let currency_code = CurrencyCode::from_str("AUD").unwrap();
assert_eq!("AUD", currency_code);

impl Hash for CurrencyCode[src]

impl PartialEq<CurrencyCode> for CurrencyCode[src]

impl<'_> PartialEq<CurrencyCode> for &'_ str[src]

impl Serialize for CurrencyCode[src]

impl StructuralEq for CurrencyCode[src]

impl StructuralPartialEq for CurrencyCode[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.