pub struct Orderbook<'a> {
pub s: &'a str,
pub b: Vec<OrderbookItem<'a>>,
pub a: Vec<OrderbookItem<'a>>,
pub u: u64,
pub seq: Option<u64>,
}Expand description
The orderbook data.
Fields§
§s: &'a strSymbol name.
b: Vec<OrderbookItem<'a>>Bids. For snapshot stream, the element is sorted by price in descending order.
a: Vec<OrderbookItem<'a>>Asks. For snapshot stream, the element is sorted by price in ascending order.
u: u64Update ID. Is a sequence. Occasionally, you’ll receive “u”=1, which is a snapshot data due to the restart of the service. So please overwrite your local orderbook.
seq: Option<u64>Cross sequence. Option does not have this field.
Trait Implementations§
Source§impl<'de: 'a, 'a> Deserialize<'de> for Orderbook<'a>
impl<'de: 'a, 'a> Deserialize<'de> for Orderbook<'a>
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
Auto Trait Implementations§
impl<'a> Freeze for Orderbook<'a>
impl<'a> RefUnwindSafe for Orderbook<'a>
impl<'a> Send for Orderbook<'a>
impl<'a> Sync for Orderbook<'a>
impl<'a> Unpin for Orderbook<'a>
impl<'a> UnwindSafe for Orderbook<'a>
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