Struct fdb_rl::RecordVersion
source · pub struct RecordVersion {
incarnation_version: Option<u64>,
global_version: Bytes,
local_version: u16,
complete: bool,
}
Expand description
Type representing a specific version within FDB.
This is designed to inter-operate with the Versionstamp
type
used to serialize versions within FoundationDB. The version
consists of three parts: a incarnation version, a global version,
a local version.
The incarnation version must be set by the user, and must be incremented by the user each time the record is moved to a different FoundationDB cluster.
The global version is a 10 byte version that is set by the database, and is used to impose an ordering between different transactions within a FoundationDB cluster.
The local version should be set by the user, and it must be used to impose an order on different records within a single transaction.
Together the incarnation version, global version and local version
are used to impose a total order across all records. Incarnation
version and local version can be managed using RecordContext
.
Fields§
§incarnation_version: Option<u64>
§global_version: Bytes
Corresponds to tr_version
field in the Versionstamp
struct. In RecordLayer FDBRecordVersion
class, this field is
known as versionBytes
.
local_version: u16
Corresponds to user_version
field in the Versionstamp
struct.
complete: bool
Implementations§
source§impl RecordVersion
impl RecordVersion
sourcepub fn get_incarnation_version(&self) -> Option<u64>
pub fn get_incarnation_version(&self) -> Option<u64>
Get incarnation version. When no incarnation version is
present, then None
is returned.
sourcepub fn get_versionstamp(&self) -> Versionstamp
pub fn get_versionstamp(&self) -> Versionstamp
Get Versionstamp
.
pub(crate) fn into_parts(self) -> (Option<u64>, Bytes, u16, bool)
Trait Implementations§
source§impl Clone for RecordVersion
impl Clone for RecordVersion
source§fn clone(&self) -> RecordVersion
fn clone(&self) -> RecordVersion
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RecordVersion
impl Debug for RecordVersion
source§impl From<(u64, Versionstamp)> for RecordVersion
impl From<(u64, Versionstamp)> for RecordVersion
source§fn from((i, vs): (u64, Versionstamp)) -> RecordVersion
fn from((i, vs): (u64, Versionstamp)) -> RecordVersion
source§impl From<Versionstamp> for RecordVersion
impl From<Versionstamp> for RecordVersion
source§fn from(value: Versionstamp) -> RecordVersion
fn from(value: Versionstamp) -> RecordVersion
source§impl Ord for RecordVersion
impl Ord for RecordVersion
source§fn cmp(&self, other: &RecordVersion) -> Ordering
fn cmp(&self, other: &RecordVersion) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<RecordVersion> for RecordVersion
impl PartialEq<RecordVersion> for RecordVersion
source§fn eq(&self, other: &RecordVersion) -> bool
fn eq(&self, other: &RecordVersion) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<RecordVersion> for RecordVersion
impl PartialOrd<RecordVersion> for RecordVersion
source§fn partial_cmp(&self, other: &RecordVersion) -> Option<Ordering>
fn partial_cmp(&self, other: &RecordVersion) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more