Struct Tick
pub struct Tick { /* private fields */ }Expand description
A single price tick with optional timestamp label and size.
Implementations§
§impl Tick
impl Tick
pub const fn new(kind: TickKind, price: MarketPrice) -> Tick
pub const fn new(kind: TickKind, price: MarketPrice) -> Tick
Creates a tick from a kind and price.
pub fn with_timestamp(
self,
timestamp: impl AsRef<str>,
) -> Result<Tick, TickError>
pub fn with_timestamp( self, timestamp: impl AsRef<str>, ) -> Result<Tick, TickError>
Attaches a non-empty timestamp label.
§Errors
Returns [TickError::EmptyTimestamp] when the trimmed label is empty.
pub fn with_size(self, size: f64) -> Result<Tick, TickError>
pub fn with_size(self, size: f64) -> Result<Tick, TickError>
Attaches a finite non-negative size.
§Errors
Returns [TickError::NonFiniteSize] or [TickError::NegativeSize] when size is invalid.
pub const fn price(&self) -> MarketPrice
pub const fn price(&self) -> MarketPrice
Returns the tick price.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tick
impl RefUnwindSafe for Tick
impl Send for Tick
impl Sync for Tick
impl Unpin for Tick
impl UnsafeUnpin for Tick
impl UnwindSafe for Tick
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