pub struct MatchingEngine { /* private fields */ }Expand description
High-performance matching engine for order matching and execution
Implementations§
Source§impl MatchingEngine
impl MatchingEngine
Sourcepub fn add_instrument(&mut self, instrument_id: InstrumentId)
pub fn add_instrument(&mut self, instrument_id: InstrumentId)
Add a new instrument to the matching engine
Sourcepub fn process_order(&mut self, order: Order) -> OrderResult
pub fn process_order(&mut self, order: Order) -> OrderResult
Process a new order
Sourcepub fn cancel_order(
&mut self,
order_id: OrderId,
instrument_id: &InstrumentId,
) -> Option<Order>
pub fn cancel_order( &mut self, order_id: OrderId, instrument_id: &InstrumentId, ) -> Option<Order>
Cancel an order
§Panics
Panics if the instrument exists in order_books but not in buy_orders or sell_orders.
This should never happen in normal operation as these data structures are kept in sync.
Sourcepub fn get_order_book(
&self,
instrument_id: &InstrumentId,
) -> Option<&SharedSimdOrderBook>
pub fn get_order_book( &self, instrument_id: &InstrumentId, ) -> Option<&SharedSimdOrderBook>
Get the order book for an instrument
Sourcepub fn clean_up_filled_orders(&mut self)
pub fn clean_up_filled_orders(&mut self)
Clean up filled orders
Trait Implementations§
Source§impl Debug for MatchingEngine
impl Debug for MatchingEngine
Auto Trait Implementations§
impl Freeze for MatchingEngine
impl RefUnwindSafe for MatchingEngine
impl Send for MatchingEngine
impl Sync for MatchingEngine
impl Unpin for MatchingEngine
impl UnwindSafe for MatchingEngine
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