pub struct ClockReading {
pub wall: Timestamp,
pub elapsed: Duration,
}Expand description
Both of a clock’s readings, taken together.
The one translation between them: where an absolute instant falls on the clock nothing steps, as seen from the moment this was read. It is taken once per instant translated, and never again, so that a later step of the wall clock cannot move a wait already being counted down.
Fields§
§wall: TimestampWhat the wall clock read.
elapsed: DurationWhat the clock nothing steps read at the same moment.
Implementations§
Source§impl ClockReading
impl ClockReading
Sourcepub fn elapsed_at(&self, instant: Timestamp) -> Duration
pub fn elapsed_at(&self, instant: Timestamp) -> Duration
Where instant falls on Clock::elapsed, as this reading sees it:
as far after this reading’s own elapsed as instant is after its
wall, and as far before it — down to the clock’s origin — as instant
is before.
Trait Implementations§
Source§impl Clone for ClockReading
impl Clone for ClockReading
impl Copy for ClockReading
Source§impl Debug for ClockReading
impl Debug for ClockReading
impl Eq for ClockReading
Source§impl PartialEq for ClockReading
impl PartialEq for ClockReading
impl StructuralPartialEq for ClockReading
Auto Trait Implementations§
impl Forget for ClockReading
impl Freeze for ClockReading
impl Move for ClockReading
impl RefUnwindSafe for ClockReading
impl Send for ClockReading
impl Sync for ClockReading
impl Unpin for ClockReading
impl UnsafeUnpin for ClockReading
impl UnwindSafe for ClockReading
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