pub struct BlockTradePoint {
pub ts_ms: i64,
pub block_id: String,
pub price: f64,
pub quantity: f64,
pub side: TradeSide,
pub is_iv: bool,
}Expand description
Block trade — large off-book print, identified by exchange-issued block_id.
Disk layout:
- Header (44 B):
ts_ms (8) | price (8) | quantity (8) | side (1) | is_iv (1) | _pad (6) | blob_off (8) | blob_len (4). - Blob:
len(block_id):u16 | block_id_utf8.
Fields§
§ts_ms: i64§block_id: String§price: f64§quantity: f64§side: TradeSide§is_iv: boolTrait Implementations§
Source§impl Clone for BlockTradePoint
impl Clone for BlockTradePoint
Source§fn clone(&self) -> BlockTradePoint
fn clone(&self) -> BlockTradePoint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl DataPoint for BlockTradePoint
impl DataPoint for BlockTradePoint
Source§const RECORD_SIZE: usize = 44
const RECORD_SIZE: usize = 44
On-disk record size in bytes. MUST be constant for the type. Read more
Source§fn encode(&self, out: &mut [u8])
fn encode(&self, out: &mut [u8])
Encode
self to a fixed-size buffer (little-endian). Read moreSource§fn decode(bytes: &[u8]) -> Option<Self>
fn decode(bytes: &[u8]) -> Option<Self>
Decode from a fixed-size buffer. Returns None on malformed bytes. Read more
Source§fn timestamp_ms(&self) -> i64
fn timestamp_ms(&self) -> i64
Timestamp in milliseconds. Used for warm-start / range queries.
Source§fn from_stream_event(ev: &StreamEvent) -> Option<Self>
fn from_stream_event(ev: &StreamEvent) -> Option<Self>
Try to extract
Self from a raw WS StreamEvent. Returns None if the
event doesn’t carry data for this class.Source§fn encode_blob(&self) -> Option<Vec<u8>>
fn encode_blob(&self) -> Option<Vec<u8>>
Variable-length bytes to append to the companion
.blob file. Read moreSource§impl Debug for BlockTradePoint
impl Debug for BlockTradePoint
Source§impl<'de> Deserialize<'de> for BlockTradePoint
impl<'de> Deserialize<'de> for BlockTradePoint
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 BlockTradePoint
impl RefUnwindSafe for BlockTradePoint
impl Send for BlockTradePoint
impl Sync for BlockTradePoint
impl Unpin for BlockTradePoint
impl UnsafeUnpin for BlockTradePoint
impl UnwindSafe for BlockTradePoint
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