pub struct Tick {
pub price: f64,
pub volume: f64,
pub timestamp: i64,
}Expand description
A single trade tick.
Fields§
§price: f64Trade price.
volume: f64Trade size.
timestamp: i64Trade timestamp (caller-defined epoch / resolution).
Implementations§
Source§impl Tick
impl Tick
Sourcepub fn new(price: f64, volume: f64, timestamp: i64) -> Result<Self>
pub fn new(price: f64, volume: f64, timestamp: i64) -> Result<Self>
Construct a new tick, validating finiteness and non-negativity of volume.
§Errors
Returns Error::NonFiniteInput if price or volume is NaN or infinite,
or Error::InvalidTick for volume < 0. (Audit finding R14 — previously
returned Error::InvalidCandle, which is semantically wrong for a tick.)
Trait Implementations§
impl Copy for Tick
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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