pub struct Orderbook {
pub market_id: String,
pub asset_id: String,
pub bids: Vec<PriceLevel>,
pub asks: Vec<PriceLevel>,
pub last_update_id: Option<u64>,
pub timestamp: Option<DateTime<Utc>>,
}Fields§
§market_id: String§asset_id: String§bids: Vec<PriceLevel>§asks: Vec<PriceLevel>§last_update_id: Option<u64>§timestamp: Option<DateTime<Utc>>Implementations§
Source§impl Orderbook
impl Orderbook
pub fn best_bid(&self) -> Option<f64>
pub fn best_ask(&self) -> Option<f64>
pub fn mid_price(&self) -> Option<f64>
pub fn spread(&self) -> Option<f64>
pub fn has_data(&self) -> bool
pub fn from_rest_response( bids: &[RestPriceLevel], asks: &[RestPriceLevel], asset_id: impl Into<String>, ) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Orderbook
impl<'de> Deserialize<'de> for Orderbook
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 Orderbook
impl RefUnwindSafe for Orderbook
impl Send for Orderbook
impl Sync for Orderbook
impl Unpin for Orderbook
impl UnwindSafe for Orderbook
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