OrderBookMap

Trait OrderBookMap 

Source
pub trait OrderBookMap: Clone {
    type Key;

    // Required methods
    fn keys(&self) -> impl Iterator<Item = &Self::Key>;
    fn find(&self, key: &Self::Key) -> Option<Arc<RwLock<OrderBook>>>;
}
Expand description

Collection of shared-state Instrument OrderBooks. Manage the local books using the super::manager module, and then clone the map for viewing the up to date OrderBooks elsewhere.

See OrderBookMapSingle and OrderBookMapMulti for implementations.

Required Associated Types§

Required Methods§

Source

fn keys(&self) -> impl Iterator<Item = &Self::Key>

Return an Iterator over the OrderBookMap Keys (eg/ InstrumentKey).

Source

fn find(&self, key: &Self::Key) -> Option<Arc<RwLock<OrderBook>>>

Attempt to find the OrderBook associated with the provided Key.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Key> OrderBookMap for OrderBookMapMulti<Key>
where Key: Clone + Eq + Hash,

Source§

type Key = Key

Source§

impl<Key> OrderBookMap for OrderBookMapSingle<Key>
where Key: PartialEq + Clone,

Source§

type Key = Key