pub struct SystemClock;Expand description
A clock backed by std::time::SystemTime::now(), returning seconds
since the Unix epoch. Available only when the std feature is on.
Trait Implementations§
Source§impl Clock for SystemClock
Available on crate feature std only.
impl Clock for SystemClock
Available on crate feature
std only.Source§fn now(&self) -> u64
fn now(&self) -> u64
Returns seconds since UNIX_EPOCH. If the system clock is set to a
time before UNIX_EPOCH (effectively impossible on a sane host
but a Result::Err on duration_since), falls back to
u64::MAX — the same value NoClock uses — so a misbehaving
clock errs toward “don’t expire anything” rather than the
alternative of “expire everything immediately”.
Source§impl Clone for SystemClock
impl Clone for SystemClock
impl Copy for SystemClock
Source§impl Debug for SystemClock
impl Debug for SystemClock
Auto Trait Implementations§
impl Forget for SystemClock
impl Freeze for SystemClock
impl Move 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