Skip to main content

Currency

Trait Currency 

Source
pub trait Currency:
    Copy
    + Send
    + Sync
    + 'static {
    // Required methods
    fn code() -> &'static str;
    fn symbol() -> &'static str;
    fn scale() -> u32;
}
Expand description

Currency marker (zero-sized). Scale is fixed per currency.

Required Methods§

Source

fn code() -> &'static str

ISO-like code.

Source

fn symbol() -> &'static str

Display symbol.

Source

fn scale() -> u32

Decimal scale (fiat 2, JPY 0, BTC 8).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§