pub trait TimestampExt: Sized {
// Required methods
fn version(&self) -> u64;
fn from_version(version: u64) -> Self;
fn try_from_version(version: u64) -> Option<Self>;
}
Expand description
A helper trait to convert a Timestamp to and from an u64.
Currently the only implmentation of this trait is Timestamp
in TiKV.
It contains a physical part (first 46 bits) and a logical part (last 18 bits).
Required Methods§
Sourcefn from_version(version: u64) -> Self
fn from_version(version: u64) -> Self
Convert u64 to a timestamp.
Sourcefn try_from_version(version: u64) -> Option<Self>
fn try_from_version(version: u64) -> Option<Self>
Convert u64 to an optional timestamp, where 0
represents no timestamp.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.