Trait tikv_client::TimestampExt
source · 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.
Object Safety§
This trait is not object safe.