Trait barter_data::instrument::InstrumentData

source ·
pub trait InstrumentData
where Self: Clone + Debug + Send + Sync,
{ type Id: Debug + Clone + Send + Sync; // Required methods fn id(&self) -> &Self::Id; fn kind(&self) -> InstrumentKind; }
Expand description

Instrument related data that defines an associated unique Id.

Verbose InstrumentData is often used to subscribe to market data feeds, but it’s unique Id can then be used to key consumed MarketEvents, significantly reducing duplication in the case of complex instruments (eg/ options).

Required Associated Types§

Required Methods§

source

fn id(&self) -> &Self::Id

source

fn kind(&self) -> InstrumentKind

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl InstrumentData for Instrument

§

type Id = Instrument

source§

fn id(&self) -> &Self::Id

source§

fn kind(&self) -> InstrumentKind

Implementors§