pub struct Orderbook { /* private fields */ }
Expand description
Implementation of an orderbook with fixed size to use as a benchmark This has no use other than benchmarking.
Implementations§
Source§impl Orderbook
impl Orderbook
pub fn new() -> Self
pub fn process(&mut self, event: Event)
pub fn process_stream_bbo( &mut self, event: Event, ) -> Option<(Option<Level>, Option<Level>)>
pub fn best_bid(&self) -> Option<Level>
pub fn best_ask(&self) -> Option<Level>
pub fn top_bids(&self, n: usize) -> Vec<Level>
pub fn top_asks(&self, n: usize) -> Vec<Level>
pub fn midprice(&self) -> Option<f64>
pub fn weighted_midprice(&self) -> Option<f64>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Orderbook
impl RefUnwindSafe for Orderbook
impl Send for Orderbook
impl Sync for Orderbook
impl Unpin for Orderbook
impl UnwindSafe for Orderbook
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)