pub struct BootClock;Available on 64-bit and crate feature
std and (Linux or macOS) only.Expand description
The boot clock, which counts the time the machine was suspended: CLOCK_BOOTTIME on Linux,
CLOCK_MONOTONIC on macOS.
Right for a timeout that must expire across a suspension, which MonotonicClock would
carry past.
§Examples
use t2t_clock::{BootClock, Clock};
use t2t_core::Timedelta;
let lease = BootClock.now() + Timedelta::from_mins(5);
assert!(BootClock.now() < lease, "a lease that expires across a suspension");Trait Implementations§
Source§impl Clock for BootClock
impl Clock for BootClock
Source§type Reading = BootUptime
type Reading = BootUptime
What the clock reads.
Source§fn now(&self) -> BootUptime
fn now(&self) -> BootUptime
The time now.
impl Copy for BootClock
impl Eq for BootClock
impl StructuralPartialEq for BootClock
Auto Trait Implementations§
impl Freeze for BootClock
impl RefUnwindSafe for BootClock
impl Send for BootClock
impl Sync for BootClock
impl Unpin for BootClock
impl UnsafeUnpin for BootClock
impl UnwindSafe for BootClock
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