pub struct Ticks(pub i64);Expand description
A point or duration in time, in integer ticks.
Integer ticks keep arithmetic deterministic across targets. The tick length (for example one
millisecond) is fixed by the integrator, not by this crate. All arithmetic on ticks inside
this crate is checked; overflow is reported as Error::Overflow.
Tuple Fields§
§0: i64Implementations§
Source§impl Ticks
impl Ticks
Sourcepub const fn checked_add(self, rhs: Self) -> Option<Self>
pub const fn checked_add(self, rhs: Self) -> Option<Self>
Adds two tick values, returning None on overflow.
Sourcepub const fn checked_sub(self, rhs: Self) -> Option<Self>
pub const fn checked_sub(self, rhs: Self) -> Option<Self>
Subtracts rhs, returning None on overflow.
Sourcepub const fn checked_neg(self) -> Option<Self>
pub const fn checked_neg(self) -> Option<Self>
Negates a tick value, returning None for i64::MIN.
Trait Implementations§
impl Copy for Ticks
impl Eq for Ticks
Source§impl Ord for Ticks
impl Ord for Ticks
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Ticks
impl PartialOrd for Ticks
impl StructuralPartialEq for Ticks
Auto Trait Implementations§
impl Forget for Ticks
impl Freeze for Ticks
impl Move for Ticks
impl RefUnwindSafe for Ticks
impl Send for Ticks
impl Sync for Ticks
impl Unpin for Ticks
impl UnsafeUnpin for Ticks
impl UnwindSafe for Ticks
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