pub struct Timestamp {
pub kind: TimestampKind,
pub nanos_since_epoch: i64,
}Expand description
Timestamp on every Message. Tagged explicitly so consumers know
whether to trust it for ordering.
Fields§
§kind: TimestampKindWhether this is monotonic or wall-clock.
nanos_since_epoch: i64Nanoseconds since the Unix epoch (wall) or since process start (mono).
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub fn new(kind: TimestampKind, nanos_since_epoch: i64) -> Self
pub fn new(kind: TimestampKind, nanos_since_epoch: i64) -> Self
Construct a timestamp from nanoseconds + kind.
Sourcepub fn now_monotonic() -> Self
pub fn now_monotonic() -> Self
Current monotonic timestamp (best-effort).
Sourcepub fn now_wall_clock() -> Self
pub fn now_wall_clock() -> Self
Current wall-clock timestamp (best-effort).
Trait Implementations§
impl Copy for Timestamp
Source§impl<'de> Deserialize<'de> for Timestamp
impl<'de> Deserialize<'de> for Timestamp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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