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§

source

fn version(&self) -> u64

Convert the timestamp to u64.

source

fn from_version(version: u64) -> Self

Convert u64 to a timestamp.

source

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.

Implementors§