pub struct BookDelta {
pub symbol: String,
pub side: BookSide,
pub price: Decimal,
pub quantity: Decimal,
pub sequence: Option<u64>,
}Expand description
Incremental order book update.
Fields§
§symbol: StringSymbol this delta applies to.
side: BookSideSide of the book (bid or ask).
price: DecimalPrice level to update. quantity == 0 means remove the level.
quantity: DecimalNew resting quantity at this price. Zero removes the level.
sequence: Option<u64>Optional exchange-assigned sequence number for gap detection.
Implementations§
Source§impl BookDelta
impl BookDelta
Sourcepub fn new(
symbol: impl Into<String>,
side: BookSide,
price: Decimal,
quantity: Decimal,
) -> Self
pub fn new( symbol: impl Into<String>, side: BookSide, price: Decimal, quantity: Decimal, ) -> Self
Construct a delta without a sequence number.
Use BookDelta::with_sequence to attach the exchange sequence number
when available; sequenced deltas enable gap detection.
Sourcepub fn with_sequence(self, seq: u64) -> Self
pub fn with_sequence(self, seq: u64) -> Self
Attach an exchange sequence number to this delta.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BookDelta
impl<'de> Deserialize<'de> for BookDelta
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 BookDelta
impl RefUnwindSafe for BookDelta
impl Send for BookDelta
impl Sync for BookDelta
impl Unpin for BookDelta
impl UnsafeUnpin for BookDelta
impl UnwindSafe for BookDelta
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