Struct barter_data::subscription::book::OrderBookSide
source · pub struct OrderBookSide { /* private fields */ }Implementations§
source§impl OrderBookSide
impl OrderBookSide
sourcepub fn new<Iter, L>(side: Side, levels: Iter) -> Selfwhere
Iter: IntoIterator<Item = L>,
L: Into<Level>,
pub fn new<Iter, L>(side: Side, levels: Iter) -> Selfwhere Iter: IntoIterator<Item = L>, L: Into<Level>,
sourcepub fn upsert<Iter, L>(&mut self, levels: Iter)where
Iter: IntoIterator<Item = L>,
L: Into<Level>,
pub fn upsert<Iter, L>(&mut self, levels: Iter)where Iter: IntoIterator<Item = L>, L: Into<Level>,
Upsert a collection of Levels into this OrderBookSide.
sourcepub fn upsert_single<L>(&mut self, new_level: L)where
L: Into<Level>,
pub fn upsert_single<L>(&mut self, new_level: L)where L: Into<Level>,
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, insert new level 2b) New value is 0, log error and continue
sourcepub fn sort(&mut self)
pub fn sort(&mut self)
Sort this OrderBookSide (bids are reversed).
Trait Implementations§
source§impl Clone for OrderBookSide
impl Clone for OrderBookSide
source§fn clone(&self) -> OrderBookSide
fn clone(&self) -> OrderBookSide
Returns a copy 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 Debug for OrderBookSide
impl Debug for OrderBookSide
source§impl<'de> Deserialize<'de> for OrderBookSide
impl<'de> Deserialize<'de> for OrderBookSide
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 Ord for OrderBookSide
impl Ord for OrderBookSide
source§fn cmp(&self, other: &OrderBookSide) -> Ordering
fn cmp(&self, other: &OrderBookSide) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<OrderBookSide> for OrderBookSide
impl PartialEq<OrderBookSide> for OrderBookSide
source§fn eq(&self, other: &OrderBookSide) -> bool
fn eq(&self, other: &OrderBookSide) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd<OrderBookSide> for OrderBookSide
impl PartialOrd<OrderBookSide> for OrderBookSide
source§fn partial_cmp(&self, other: &OrderBookSide) -> Option<Ordering>
fn partial_cmp(&self, other: &OrderBookSide) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl Serialize for OrderBookSide
impl Serialize for OrderBookSide
impl Eq for OrderBookSide
impl StructuralEq for OrderBookSide
impl StructuralPartialEq for OrderBookSide
Auto Trait Implementations§
impl RefUnwindSafe for OrderBookSide
impl Send for OrderBookSide
impl Sync for OrderBookSide
impl Unpin for OrderBookSide
impl UnwindSafe for OrderBookSide
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.