Struct CurrencyPair
pub struct CurrencyPair {
pub base: Currency,
pub quote: Currency,
}Expand description
An ordered currency pair, quoted as quote units per one base.
Fields§
§base: CurrencyThe base currency — the one unit being priced.
quote: CurrencyThe quote currency — what it is priced in.
Implementations§
Trait Implementations§
§impl Clone for CurrencyPair
impl Clone for CurrencyPair
§fn clone(&self) -> CurrencyPair
fn clone(&self) -> CurrencyPair
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CurrencyPair
§impl Debug for CurrencyPair
impl Debug for CurrencyPair
§impl Display for CurrencyPair
impl Display for CurrencyPair
impl Eq for CurrencyPair
§impl FromStr for CurrencyPair
The inverse of Display: BASE/QUOTE, and the
market’s unslashed BASEQUOTE spelling too. Two distinct currencies.
impl FromStr for CurrencyPair
The inverse of Display: BASE/QUOTE, and the
market’s unslashed BASEQUOTE spelling too. Two distinct currencies.
§impl Hash for CurrencyPair
impl Hash for CurrencyPair
§impl Ord for CurrencyPair
Ordered by the two codes, so a store’s pairs sort predictably and a lookup
can binary-search them. Currency itself carries no order — it is a
validated three-byte code, and nothing below this layer needs to sort one.
impl Ord for CurrencyPair
Ordered by the two codes, so a store’s pairs sort predictably and a lookup
can binary-search them. Currency itself carries no order — it is a
validated three-byte code, and nothing below this layer needs to sort one.
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
§impl PartialEq for CurrencyPair
impl PartialEq for CurrencyPair
§impl PartialOrd for CurrencyPair
impl PartialOrd for CurrencyPair
impl StructuralPartialEq for CurrencyPair
Auto Trait Implementations§
impl Freeze for CurrencyPair
impl RefUnwindSafe for CurrencyPair
impl Send for CurrencyPair
impl Sync for CurrencyPair
impl Unpin for CurrencyPair
impl UnsafeUnpin for CurrencyPair
impl UnwindSafe for CurrencyPair
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more