pub struct Timestamp(/* private fields */);Implementations§
Source§impl Timestamp
impl Timestamp
pub const fn zero() -> Self
pub const fn plus_infinity() -> Self
pub const fn minus_infinity() -> Self
pub const fn is_zero(&self) -> bool
pub const fn is_finite(&self) -> bool
pub const fn is_infinite(&self) -> bool
pub const fn is_plus_infinity(&self) -> bool
pub const fn is_minus_infinity(&self) -> bool
pub const fn round_to(&self, resolution: Self) -> Self
pub const fn round_up_to(&self, resolution: Self) -> Self
pub const fn round_down_to(&self, resolution: Self) -> Self
pub const fn to_multiple(self, factor: i64) -> i64
pub fn to_multiple_float(self, factor: f64) -> f64
Source§impl Timestamp
impl Timestamp
pub const fn from_seconds(value: i64) -> Self
pub fn from_seconds_float(value: f64) -> Self
pub const fn from_millis(value: i64) -> Self
pub fn from_millis_float(value: f64) -> Self
pub const fn from_micros(value: i64) -> Self
pub fn from_micros_float(value: f64) -> Self
pub const fn seconds(&self) -> i64
pub fn seconds_float(&self) -> f64
pub const fn ms(&self) -> i64
pub fn ms_float(&self) -> f64
pub const fn us(&self) -> i64
pub const fn us_float(&self) -> f64
pub const fn seconds_or(&self, fallback_value: i64) -> i64
pub const fn ms_or(&self, fallback_value: i64) -> i64
pub const fn us_or(&self, fallback_value: i64) -> i64
Trait Implementations§
Source§impl AddAssign<TimeDelta> for Timestamp
impl AddAssign<TimeDelta> for Timestamp
Source§fn add_assign(&mut self, delta: TimeDelta)
fn add_assign(&mut self, delta: TimeDelta)
Performs the
+= operation. Read moreSource§impl Ord for Timestamp
impl Ord for Timestamp
Source§impl PartialOrd for Timestamp
impl PartialOrd for Timestamp
Source§impl SubAssign<TimeDelta> for Timestamp
impl SubAssign<TimeDelta> for Timestamp
Source§fn sub_assign(&mut self, delta: TimeDelta)
fn sub_assign(&mut self, delta: TimeDelta)
Performs the
-= operation. Read moreimpl Copy for Timestamp
impl Eq for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations§
impl Freeze for Timestamp
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnwindSafe for Timestamp
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