pub struct OrderMatchingEngine {
pub venue: Venue,
pub instrument: InstrumentAny,
pub raw_id: u32,
pub book_type: BookType,
pub oms_type: OmsType,
pub account_type: AccountType,
pub market_status: MarketStatus,
pub config: OrderMatchingEngineConfig,
/* private fields */
}
Expand description
An order matching engine for a single market.
Fields§
§venue: Venue
The venue for the matching engine.
instrument: InstrumentAny
The instrument for the matching engine.
raw_id: u32
The instruments raw integer ID for the venue.
book_type: BookType
The order book type for the matching engine.
oms_type: OmsType
The order management system (OMS) type for the matching engine.
account_type: AccountType
The account type for the matching engine.
market_status: MarketStatus
The market status for the matching engine.
config: OrderMatchingEngineConfig
The config for the matching engine.
Implementations§
Source§impl OrderMatchingEngine
impl OrderMatchingEngine
Sourcepub fn new(
instrument: InstrumentAny,
raw_id: u32,
fill_model: FillModel,
book_type: BookType,
oms_type: OmsType,
account_type: AccountType,
clock: &'static AtomicTime,
msgbus: Rc<RefCell<MessageBus>>,
cache: Rc<RefCell<Cache>>,
config: OrderMatchingEngineConfig,
) -> Self
pub fn new( instrument: InstrumentAny, raw_id: u32, fill_model: FillModel, book_type: BookType, oms_type: OmsType, account_type: AccountType, clock: &'static AtomicTime, msgbus: Rc<RefCell<MessageBus>>, cache: Rc<RefCell<Cache>>, config: OrderMatchingEngineConfig, ) -> Self
Creates a new OrderMatchingEngine
instance.
pub fn reset(&mut self)
pub fn set_fill_model(&mut self, fill_model: FillModel)
pub fn best_bid_price(&self) -> Option<Price>
pub fn best_ask_price(&self) -> Option<Price>
pub const fn get_book(&self) -> &OrderBook
pub fn get_open_bid_orders(&self) -> &[PassiveOrderAny]
pub fn get_open_ask_orders(&self) -> &[PassiveOrderAny]
pub fn get_open_orders(&self) -> Vec<PassiveOrderAny>
pub fn order_exists(&self, client_order_id: ClientOrderId) -> bool
Sourcepub fn process_order_book_delta(&mut self, delta: &OrderBookDelta)
pub fn process_order_book_delta(&mut self, delta: &OrderBookDelta)
Process the venues market for the given order book delta.
pub fn process_order_book_deltas(&mut self, deltas: &OrderBookDeltas)
pub fn process_quote_tick(&mut self, quote: &QuoteTick)
pub fn process_bar(&mut self, bar: &Bar)
pub fn process_trade_tick(&mut self, trade: &TradeTick)
pub fn process_status(&mut self, action: MarketStatusAction)
pub fn process_order(&mut self, order: &OrderAny, account_id: AccountId)
Auto Trait Implementations§
impl Freeze for OrderMatchingEngine
impl !RefUnwindSafe for OrderMatchingEngine
impl !Send for OrderMatchingEngine
impl !Sync for OrderMatchingEngine
impl Unpin for OrderMatchingEngine
impl !UnwindSafe for OrderMatchingEngine
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more