Trait Instrument

Source
pub trait Instrument:
    'static
    + Send
    + Sync
    + Debug {
    // Required methods
    fn id(&self) -> InstrumentId;
    fn as_any(&self) -> &dyn Any;
    fn clone_box(&self) -> Box<dyn Instrument>;

    // Provided methods
    fn symbol(&self) -> SmartString { ... }
    fn venue(&self) -> Venue { ... }
}
Expand description

Instrument trait for representing tradable assets on exchanges

Required Methods§

Source

fn id(&self) -> InstrumentId

Get the instrument ID

Source

fn as_any(&self) -> &dyn Any

Convert to Any for downcasting

Source

fn clone_box(&self) -> Box<dyn Instrument>

Clone this instrument into a new box

Provided Methods§

Source

fn symbol(&self) -> SmartString

Get the symbol (shorthand for id().symbol)

Source

fn venue(&self) -> Venue

Get the venue (shorthand for id().venue)

Implementors§