Skip to main content

OrderBook

Struct OrderBook 

pub struct OrderBook {
    pub symbol: String,
    /* private fields */
}

Fields§

§symbol: String

Implementations§

§

impl OrderBook

pub fn new(symbol: &str) -> Self

pub fn with_max_order_id(symbol: &str, max_order_id: usize) -> Self

pub fn with_max_order_id_and_capacity( symbol: &str, max_order_id: usize, order_capacity: usize, ) -> Self

pub fn with_capacity(symbol: &str, order_capacity: usize) -> Self

pub fn submit_limit( &mut self, order_id: u64, price: i64, quantity: u64, side: Side, ) -> Result<MatchResult, MatchError>

pub fn submit_limit_with_tif( &mut self, order_id: u64, price: i64, quantity: u64, side: Side, time_in_force: TimeInForce, ) -> Result<MatchResult, MatchError>

pub fn submit(&mut self, order: Order) -> Result<MatchResult, MatchError>

pub fn submit_ext(&mut self, order: Order) -> Result<MatchResultExt, MatchError>

pub fn recover_order(&mut self, order: Order) -> Result<(), MatchError>

pub fn max_order_id(&self) -> usize

pub fn set_next_fill_id(&mut self, next_fill_id: u64)

pub fn cancel(&mut self, order_id: u64) -> Result<Order, MatchError>

pub fn best_bid(&self) -> Option<i64>

pub fn best_ask(&self) -> Option<i64>

pub fn spread(&self) -> Option<i64>

pub fn depth(&self, side: Side, levels: usize) -> Vec<(i64, u64)>

pub fn order_count(&self) -> usize

pub fn contains_order(&self, order_id: u64) -> bool

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

§

impl<T> From<T> for T

§

fn from(t: T) -> T

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>