pub enum Timestamp {
Epoch(u64),
System(u64),
}Expand description
The timestamp an event record carries (§7.14.1.2).
This timestamp SHALL either be System Time in milliseconds or POSIX Time in milliseconds.
Which one a node uses depends on whether it knows the wall-clock time —
Clock::utc returning None is exactly the case for
System. A node must not invent an epoch time it does not have: a client comparing
timestamps across nodes would be comparing an uptime with a date.
Variants§
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub const fn absolute(self) -> EventTimestamp
pub const fn absolute(self) -> EventTimestamp
The absolute EventDataIB form (§10.6.9).
Sourcepub fn delta_from(self, previous: Self) -> Option<EventTimestamp>
pub fn delta_from(self, previous: Self) -> Option<EventTimestamp>
The delta form against previous, when both are the same kind and previous is no
later (§10.6.9.1, §10.6.9.2).
None when they cannot be compared — different kinds, or a timestamp that went
backwards — in which case the absolute form is the only correct encoding. Encoding a
delta across a kind change would produce a number with no meaning at all.