#[repr(C)]pub struct ZeroCopyPriceLevel {
pub price: u64,
pub quantity: u64,
}Expand description
Zero-copy price level structure
Represents a single price level in an order book with fixed-size fields suitable for direct binary parsing.
Fields§
§price: u64Price as fixed-point integer (e.g., price * 100000000 for 8 decimals)
quantity: u64Quantity as fixed-point integer
Implementations§
Source§impl ZeroCopyPriceLevel
impl ZeroCopyPriceLevel
Sourcepub fn to_decimal_price(&self, decimals: u32) -> Decimal
pub fn to_decimal_price(&self, decimals: u32) -> Decimal
Convert from fixed-point to rust_decimal::Decimal
Sourcepub fn to_decimal_quantity(&self, decimals: u32) -> Decimal
pub fn to_decimal_quantity(&self, decimals: u32) -> Decimal
Convert from fixed-point to rust_decimal::Decimal
Source§impl ZeroCopyPriceLevel
impl ZeroCopyPriceLevel
Sourcepub fn from_bytes(bytes: &[u8]) -> Option<&Self>
pub fn from_bytes(bytes: &[u8]) -> Option<&Self>
Create from bytes
Trait Implementations§
Source§impl Clone for ZeroCopyPriceLevel
impl Clone for ZeroCopyPriceLevel
Source§fn clone(&self) -> ZeroCopyPriceLevel
fn clone(&self) -> ZeroCopyPriceLevel
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ZeroCopyPriceLevel
impl Debug for ZeroCopyPriceLevel
impl Copy for ZeroCopyPriceLevel
impl Pod for ZeroCopyPriceLevel
Auto Trait Implementations§
impl Freeze for ZeroCopyPriceLevel
impl RefUnwindSafe for ZeroCopyPriceLevel
impl Send for ZeroCopyPriceLevel
impl Sync for ZeroCopyPriceLevel
impl Unpin for ZeroCopyPriceLevel
impl UnwindSafe for ZeroCopyPriceLevel
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
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.