Struct QuoteTick
pub struct QuoteTick { /* private fields */ }Expand description
A quote tick with optional bid and ask prices.
Implementations§
§impl QuoteTick
impl QuoteTick
pub fn new(
bid: Option<MarketPrice>,
ask: Option<MarketPrice>,
) -> Result<QuoteTick, TickError>
pub fn new( bid: Option<MarketPrice>, ask: Option<MarketPrice>, ) -> Result<QuoteTick, TickError>
Creates a quote tick and rejects crossed bid/ask values when both sides are present.
§Errors
Returns [TickError::CrossedQuote] when ask < bid.
pub fn with_timestamp(
self,
timestamp: impl AsRef<str>,
) -> Result<QuoteTick, TickError>
pub fn with_timestamp( self, timestamp: impl AsRef<str>, ) -> Result<QuoteTick, TickError>
Attaches a non-empty timestamp label.
§Errors
Returns [TickError::EmptyTimestamp] when the trimmed label is empty.
pub const fn bid(&self) -> Option<MarketPrice>
pub const fn bid(&self) -> Option<MarketPrice>
Returns the optional bid price.
pub const fn ask(&self) -> Option<MarketPrice>
pub const fn ask(&self) -> Option<MarketPrice>
Returns the optional ask price.
Trait Implementations§
impl StructuralPartialEq for QuoteTick
Auto Trait Implementations§
impl Freeze for QuoteTick
impl RefUnwindSafe for QuoteTick
impl Send for QuoteTick
impl Sync for QuoteTick
impl Unpin for QuoteTick
impl UnsafeUnpin for QuoteTick
impl UnwindSafe for QuoteTick
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