pub struct PositionUpdatePoint {
pub ts_ms: i64,
pub side: u8,
pub qty: f64,
pub entry_price: f64,
pub mark_price: f64,
pub unrealized_pnl: f64,
pub realized_pnl: f64,
pub liquidation_price: f64,
}Expand description
On-disk record (64 bytes LE) for a futures position change event: u64 ts_ms (8) u8 side (1) — 0=Long 1=Short 2=Net/Both u8 _pad (7) f64 qty (8) — position size (signed in net mode; absolute here) f64 entry_price (8) f64 mark_price (8) — 0.0 if unknown f64 unrealized_pnl (8) f64 realized_pnl (8) — 0.0 if not provided f64 liquidation_price (8) — 0.0 if unknown Total: 64 bytes
Fields§
§ts_ms: i64§side: u80=Long, 1=Short, 2=Net/Both
qty: f64§entry_price: f64§mark_price: f64§unrealized_pnl: f64§realized_pnl: f64§liquidation_price: f64Implementations§
Source§impl PositionUpdatePoint
impl PositionUpdatePoint
pub fn side_label(&self) -> &'static str
Trait Implementations§
Source§impl Clone for PositionUpdatePoint
impl Clone for PositionUpdatePoint
Source§fn clone(&self) -> PositionUpdatePoint
fn clone(&self) -> PositionUpdatePoint
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 PositionUpdatePoint
impl DataPoint for PositionUpdatePoint
Source§const RECORD_SIZE: usize = SIZE
const RECORD_SIZE: usize = SIZE
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 PositionUpdatePoint
impl Debug for PositionUpdatePoint
Source§impl<'de> Deserialize<'de> for PositionUpdatePoint
impl<'de> Deserialize<'de> for PositionUpdatePoint
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 PartialEq for PositionUpdatePoint
impl PartialEq for PositionUpdatePoint
Source§fn eq(&self, other: &PositionUpdatePoint) -> bool
fn eq(&self, other: &PositionUpdatePoint) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PositionUpdatePoint
impl Serialize for PositionUpdatePoint
impl StructuralPartialEq for PositionUpdatePoint
Auto Trait Implementations§
impl Freeze for PositionUpdatePoint
impl RefUnwindSafe for PositionUpdatePoint
impl Send for PositionUpdatePoint
impl Sync for PositionUpdatePoint
impl Unpin for PositionUpdatePoint
impl UnsafeUnpin for PositionUpdatePoint
impl UnwindSafe for PositionUpdatePoint
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