pub struct OrderBookSnapshot {
pub symbol: String,
pub bids: Vec<Bid>,
pub asks: Vec<Ask>,
pub update_id: u64,
pub seq: u64,
pub timestamp: u64,
}Expand description
Structure for persisting order book snapshots.
Fields§
§symbol: StringTrading symbol
bids: Vec<Bid>Bid levels
asks: Vec<Ask>Ask levels
update_id: u64Update ID
seq: u64Sequence number
timestamp: u64Timestamp when snapshot was taken
Implementations§
Source§impl OrderBookSnapshot
impl OrderBookSnapshot
Sourcepub fn from_order_book(order_book: &WsOrderBook) -> Self
pub fn from_order_book(order_book: &WsOrderBook) -> Self
Creates a new OrderBookSnapshot from a WsOrderBook.
Sourcepub fn to_order_book(&self) -> WsOrderBook
pub fn to_order_book(&self) -> WsOrderBook
Converts the snapshot back to a WsOrderBook.
Trait Implementations§
Source§impl Clone for OrderBookSnapshot
impl Clone for OrderBookSnapshot
Source§fn clone(&self) -> OrderBookSnapshot
fn clone(&self) -> OrderBookSnapshot
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 Debug for OrderBookSnapshot
impl Debug for OrderBookSnapshot
Source§impl<'de> Deserialize<'de> for OrderBookSnapshot
impl<'de> Deserialize<'de> for OrderBookSnapshot
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 Freeze for OrderBookSnapshot
impl RefUnwindSafe for OrderBookSnapshot
impl Send for OrderBookSnapshot
impl Sync for OrderBookSnapshot
impl Unpin for OrderBookSnapshot
impl UnsafeUnpin for OrderBookSnapshot
impl UnwindSafe for OrderBookSnapshot
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