pub struct Timestamp {
pub secs: i64,
pub nanos: u32,
}Expand description
a point in time: seconds since 1970-01-01 00:00:00 UTC and nanoseconds
Fields§
§secs: i64§nanos: u32Implementations§
Source§impl Timestamp
impl Timestamp
pub const fn from_secs(secs: i64) -> Timestamp
Sourcepub const fn from_nanos(ns: i64) -> Timestamp
pub const fn from_nanos(ns: i64) -> Timestamp
from nanoseconds since the epoch (plat::unix_time_ns)
pub const fn from_millis(ms: i64) -> Timestamp
pub const fn as_millis(&self) -> i64
pub const fn add_secs(&self, s: i64) -> Timestamp
Trait Implementations§
impl Copy for Timestamp
impl Eq for Timestamp
Source§impl Ord for Timestamp
impl Ord for Timestamp
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 Timestamp
impl PartialOrd for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations§
impl Forget for Timestamp
impl Freeze for Timestamp
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnsafeUnpin 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