pub struct VersionedKey {
pub user_key: Vec<u8>,
pub commit_ts: u64,
}Expand description
A versioned key for MVCC storage.
Encodes a user key and a timestamp into a single byte array, allowing for efficient range scans and version retrieval.
Format: [UserKey bytes] + [!Timestamp (8 bytes, Big Endian)]
The timestamp is stored as bit-inverted (!ts) big-endian to ensure
that newer versions (higher timestamps) appear first in lexicographical order.
Fields§
§user_key: Vec<u8>§commit_ts: u64Implementations§
Source§impl VersionedKey
impl VersionedKey
Sourcepub fn extract_user_key(bytes: &[u8]) -> Option<&[u8]>
pub fn extract_user_key(bytes: &[u8]) -> Option<&[u8]>
Extract user key from encoded bytes without full decoding.
Trait Implementations§
Source§impl Clone for VersionedKey
impl Clone for VersionedKey
Source§fn clone(&self) -> VersionedKey
fn clone(&self) -> VersionedKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VersionedKey
impl Debug for VersionedKey
Source§impl Ord for VersionedKey
impl Ord for VersionedKey
Source§impl PartialEq for VersionedKey
impl PartialEq for VersionedKey
Source§impl PartialOrd for VersionedKey
impl PartialOrd for VersionedKey
impl Eq for VersionedKey
impl StructuralPartialEq for VersionedKey
Auto Trait Implementations§
impl Freeze for VersionedKey
impl RefUnwindSafe for VersionedKey
impl Send for VersionedKey
impl Sync for VersionedKey
impl Unpin for VersionedKey
impl UnsafeUnpin for VersionedKey
impl UnwindSafe for VersionedKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more