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