pub struct PriceLevel {
pub price: String,
pub price_f64: f64,
pub size: String,
pub size_f64: f64,
}Expand description
A price level in the orderbook.
Fields§
§price: StringPrice as a string (preserves decimal precision).
price_f64: f64Price as f64 for comparison and sorting.
size: StringSize/quantity at this price level.
size_f64: f64Size as f64.
Implementations§
Source§impl PriceLevel
impl PriceLevel
Sourcepub fn new(price: String, size: String) -> Result<Self, BybitError>
pub fn new(price: String, size: String) -> Result<Self, BybitError>
Create a new price level from strings.
Sourcepub fn from_entry(entry: &OrderbookEntry) -> Result<Self, BybitError>
pub fn from_entry(entry: &OrderbookEntry) -> Result<Self, BybitError>
Create from an orderbook entry.
Trait Implementations§
Source§impl Clone for PriceLevel
impl Clone for PriceLevel
Source§fn clone(&self) -> PriceLevel
fn clone(&self) -> PriceLevel
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 PriceLevel
impl Debug for PriceLevel
Source§impl PartialEq for PriceLevel
impl PartialEq for PriceLevel
impl StructuralPartialEq for PriceLevel
Auto Trait Implementations§
impl Freeze for PriceLevel
impl RefUnwindSafe for PriceLevel
impl Send for PriceLevel
impl Sync for PriceLevel
impl Unpin for PriceLevel
impl UnwindSafe for PriceLevel
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