pub struct Timestamp { /* private fields */ }Expand description
§7.2: 48-bit milliseconds, a 16-bit counter, and a 64-bit device id, ordered in that order. No clock is read here.
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub const MAX_MILLISECONDS: u64
pub const MAX_MILLISECONDS: u64
The greatest millisecond the timestamp can represent.
Sourcepub fn new(
milliseconds: u64,
counter: u16,
device: DeviceId,
) -> Result<Self, MergeError>
pub fn new( milliseconds: u64, counter: u16, device: DeviceId, ) -> Result<Self, MergeError>
Construct a timestamp, refusing milliseconds outside its 48-bit range.
Sourcepub fn next(
latest: Option<Self>,
clock_ms: u64,
device: DeviceId,
) -> Result<Self, MergeError>
pub fn next( latest: Option<Self>, clock_ms: u64, device: DeviceId, ) -> Result<Self, MergeError>
Stamp a local write or entry after the latest timestamp from local work and applied incoming work. The caller persists that latest timestamp. A counter overflow advances the millisecond; exhaustion is an error.
Sourcepub fn milliseconds(self) -> u64
pub fn milliseconds(self) -> u64
The wall-clock part, in milliseconds.
Trait Implementations§
Source§impl Ord for Timestamp
impl Ord for Timestamp
Source§impl PartialOrd for Timestamp
impl PartialOrd for Timestamp
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more