pub struct Timestamp {
pub wall: WallTime,
pub mono: u64,
}Expand description
A paired wall+monotonic reading.
wall: seeWallTime— may step, comparable across machines.mono: nanos on a process-local monotonic scale — never steps and, by REQ-CLK-001, never regresses across calls within a process.
No From/Into conversion exists between the two fields in either
direction; Timestamp::mono_from_wall_lossy is the single, explicitly
lossy escape hatch. REQ-CLK-002.
Fields§
§wall: WallTimeWall time — may step, cross-process/machine comparable.
mono: u64Monotonic nanos — never regresses within a process (REQ-CLK-001).
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub const fn from_parts(wall: WallTime, mono: u64) -> Self
pub const fn from_parts(wall: WallTime, mono: u64) -> Self
Assemble a timestamp from its parts.
Sourcepub fn mono_from_wall_lossy(&self) -> u64
pub fn mono_from_wall_lossy(&self) -> u64
Derive a monotonic-style value from the wall field.
Explicitly lossy and labelled as such (REQ-CLK-002): wall time steps, so the result may go backward; it lives on the wall scale, not the process-local monotonic scale. This is the only cross-derivation in the API surface.
Trait Implementations§
impl Copy for Timestamp
impl Eq for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations§
impl Freeze for Timestamp
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnsafeUnpin for Timestamp
impl UnwindSafe for Timestamp
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