pub struct Level1Quote {
pub ts: DateTime<Utc>,
pub symbol: String,
pub bid: f64,
pub bid_size: f64,
pub ask: f64,
pub ask_size: f64,
}Expand description
Level 1 quote – best bid and ask (top-of-book).
A Level 1 quote captures the current best bid and ask prices and their sizes. It is the most common form of real-time market data, sufficient for spread calculations and basic order-book imbalance metrics.
use egui_charts::model::Level1Quote;
use chrono::Utc;
let quote = Level1Quote {
ts: Utc::now(),
symbol: "BTCUSDT".into(),
bid: 50_000.0, bid_size: 1.5,
ask: 50_010.0, ask_size: 2.0,
};
assert_eq!(quote.spread(), 10.0);Fields§
§ts: DateTime<Utc>Ts of the quote
symbol: StringSymbol
bid: f64Best bid price
bid_size: f64Best bid size
ask: f64Best ask price
ask_size: f64Best ask size
Implementations§
Source§impl Level1Quote
impl Level1Quote
Trait Implementations§
Source§impl Clone for Level1Quote
impl Clone for Level1Quote
Source§fn clone(&self) -> Level1Quote
fn clone(&self) -> Level1Quote
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 Debug for Level1Quote
impl Debug for Level1Quote
Source§impl<'de> Deserialize<'de> for Level1Quote
impl<'de> Deserialize<'de> for Level1Quote
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 Level1Quote
impl PartialEq for Level1Quote
Source§impl Serialize for Level1Quote
impl Serialize for Level1Quote
impl StructuralPartialEq for Level1Quote
Auto Trait Implementations§
impl Freeze for Level1Quote
impl RefUnwindSafe for Level1Quote
impl Send for Level1Quote
impl Sync for Level1Quote
impl Unpin for Level1Quote
impl UnsafeUnpin for Level1Quote
impl UnwindSafe for Level1Quote
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more