pub struct OrderBookSide<Side> {
pub side: Side,
/* private fields */
}Fields§
§side: SideImplementations§
Source§impl OrderBookSide<Bids>
impl OrderBookSide<Bids>
Sourcepub fn bids<Iter, L>(levels: Iter) -> Self
pub fn bids<Iter, L>(levels: Iter) -> Self
Construct a new OrderBookSide<Bids> from the provided Levels.
Source§impl OrderBookSide<Asks>
impl OrderBookSide<Asks>
Sourcepub fn asks<Iter, L>(levels: Iter) -> Self
pub fn asks<Iter, L>(levels: Iter) -> Self
Construct a new OrderBookSide<Asks> from the provided Levels.
Source§impl<Side> OrderBookSide<Side>
impl<Side> OrderBookSide<Side>
Sourcepub fn levels(&self) -> &[Level]
pub fn levels(&self) -> &[Level]
Return a reference to the OrderBookSide levels.
Sourcepub fn upsert_single<FnOrd>(&mut self, new_level: Level, fn_ord: FnOrd)
pub fn upsert_single<FnOrd>(&mut self, new_level: Level, fn_ord: FnOrd)
Upsert a single Level into this OrderBookSide.
§Upsert Scenarios
§1 Level Already Exists
1a) New value is 0, remove the level 1b) New value is > 0, replace the level
§2 Level Does Not Exist
2a) New value is 0, log warn and continue 2b) New value is > 0, insert new level
Trait Implementations§
Source§impl<Side: Clone> Clone for OrderBookSide<Side>
impl<Side: Clone> Clone for OrderBookSide<Side>
Source§fn clone(&self) -> OrderBookSide<Side>
fn clone(&self) -> OrderBookSide<Side>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Side: Debug> Debug for OrderBookSide<Side>
impl<Side: Debug> Debug for OrderBookSide<Side>
Source§impl Default for OrderBookSide<Asks>
impl Default for OrderBookSide<Asks>
Source§impl Default for OrderBookSide<Bids>
impl Default for OrderBookSide<Bids>
Source§impl<'de, Side> Deserialize<'de> for OrderBookSide<Side>where
Side: Deserialize<'de>,
impl<'de, Side> Deserialize<'de> for OrderBookSide<Side>where
Side: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<Side: PartialEq> PartialEq for OrderBookSide<Side>
impl<Side: PartialEq> PartialEq for OrderBookSide<Side>
Source§impl<Side> Serialize for OrderBookSide<Side>
impl<Side> Serialize for OrderBookSide<Side>
impl<Side: Eq> Eq for OrderBookSide<Side>
impl<Side> StructuralPartialEq for OrderBookSide<Side>
Auto Trait Implementations§
impl<Side> Freeze for OrderBookSide<Side>where
Side: Freeze,
impl<Side> RefUnwindSafe for OrderBookSide<Side>where
Side: RefUnwindSafe,
impl<Side> Send for OrderBookSide<Side>where
Side: Send,
impl<Side> Sync for OrderBookSide<Side>where
Side: Sync,
impl<Side> Unpin for OrderBookSide<Side>where
Side: Unpin,
impl<Side> UnwindSafe for OrderBookSide<Side>where
Side: UnwindSafe,
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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