tikv_client

Trait 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.

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.

Implementors§