Struct SystemClock
pub struct SystemClock;Expand description
The operating system’s wall clock, in milliseconds since the Unix epoch.
Available only with the system feature: wasm32-unknown-unknown has no
such clock.
Implementations§
§impl SystemClock
impl SystemClock
pub const fn new() -> Self
pub const fn new() -> Self
Creates a system clock.
Trait Implementations§
§impl Clock for SystemClock
Available on crate feature system only.
impl Clock for SystemClock
Available on crate feature
system only.§fn now_millis(&self) -> u64
fn now_millis(&self) -> u64
Milliseconds since the Unix epoch.
Saturating and panic-free: a clock set before 1970 (or a value beyond
u64::MAX milliseconds, roughly the year 584 million) yields 0 and
u64::MAX respectively instead of unwrapping a SystemTimeError.
§impl Clone for SystemClock
impl Clone for SystemClock
§fn clone(&self) -> SystemClock
fn clone(&self) -> SystemClock
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SystemClock
§impl Debug for SystemClock
impl Debug for SystemClock
§impl Default for SystemClock
impl Default for SystemClock
§fn default() -> SystemClock
fn default() -> SystemClock
Returns the “default value” for a type. Read more
impl Eq for SystemClock
§impl PartialEq for SystemClock
impl PartialEq for SystemClock
impl StructuralPartialEq for SystemClock
Auto Trait Implementations§
impl Freeze for SystemClock
impl RefUnwindSafe for SystemClock
impl Send for SystemClock
impl Sync for SystemClock
impl Unpin for SystemClock
impl UnsafeUnpin for SystemClock
impl UnwindSafe for SystemClock
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