pub struct TaiClock;Available on 64-bit and Linux and crate feature
std and (Linux or macOS) only.Expand description
International Atomic Time, CLOCK_TAI, on Linux.
The wall clock plus the kernel’s TAI offset, which chrony or ptp4l sets to the leap
seconds since 1972; until one does, the offset is zero and this reads the wall clock.
§Examples
use t2t_clock::{Clock, SystemClock, TaiClock};
use t2t_core::Timedelta;
let ahead = Timedelta::from_nanos(TaiClock.now().as_nanos() - SystemClock.now().as_nanos());
assert!(ahead < Timedelta::from_secs(60), "at most the leap seconds since 1972: {ahead}");Trait Implementations§
Source§impl Clock for TaiClock
impl Clock for TaiClock
Source§type Reading = TaiTimestamp
type Reading = TaiTimestamp
What the clock reads.
Source§fn now(&self) -> TaiTimestamp
fn now(&self) -> TaiTimestamp
The time now.
impl Copy for TaiClock
impl Eq for TaiClock
impl StructuralPartialEq for TaiClock
Auto Trait Implementations§
impl Freeze for TaiClock
impl RefUnwindSafe for TaiClock
impl Send for TaiClock
impl Sync for TaiClock
impl Unpin for TaiClock
impl UnsafeUnpin for TaiClock
impl UnwindSafe for TaiClock
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