pub struct Version<V>where
V: Clone,{
pub created_by: TxnId,
pub created_at: Timestamp,
pub deleted_by: TxnId,
pub deleted_at: Timestamp,
pub value: Option<V>,
pub prev: Option<Box<Version<V>>>,
}Expand description
A single version of a value
Fields§
§created_by: TxnIdTransaction that created this version
created_at: TimestampTimestamp when created
deleted_by: TxnIdTransaction that deleted this version (0 if not deleted)
deleted_at: TimestampTimestamp when deleted (0 if not deleted)
value: Option<V>The value (None if this is a tombstone)
prev: Option<Box<Version<V>>>Pointer to older version
Implementations§
Source§impl<V> Version<V>where
V: Clone,
impl<V> Version<V>where
V: Clone,
Sourcepub fn tombstone(txn_id: TxnId, timestamp: Timestamp) -> Version<V>
pub fn tombstone(txn_id: TxnId, timestamp: Timestamp) -> Version<V>
Create tombstone version (delete marker)
Sourcepub fn is_tombstone(&self) -> bool
pub fn is_tombstone(&self) -> bool
Check if this version is a tombstone
Sourcepub fn is_deleted(&self) -> bool
pub fn is_deleted(&self) -> bool
Check if this version is deleted
Sourcepub fn mark_deleted(&mut self, txn_id: TxnId, timestamp: Timestamp)
pub fn mark_deleted(&mut self, txn_id: TxnId, timestamp: Timestamp)
Mark as deleted by transaction
Sourcepub fn check_visibility(&self, snapshot: &Snapshot) -> VersionVisibility
pub fn check_visibility(&self, snapshot: &Snapshot) -> VersionVisibility
Check visibility for a snapshot
Trait Implementations§
Auto Trait Implementations§
impl<V> Freeze for Version<V>where
V: Freeze,
impl<V> RefUnwindSafe for Version<V>where
V: RefUnwindSafe,
impl<V> Send for Version<V>where
V: Send,
impl<V> Sync for Version<V>where
V: Sync,
impl<V> Unpin for Version<V>where
V: Unpin,
impl<V> UnsafeUnpin for Version<V>where
V: UnsafeUnpin,
impl<V> UnwindSafe for Version<V>where
V: UnwindSafe,
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<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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request