pub struct RowVersion {
pub begin: TxTimestampOrId,
pub end: Option<TxTimestampOrId>,
pub payload: VersionPayload,
}Expand description
One link in a row’s version chain.
Visibility under snapshot isolation is the textbook rule the Hekaton paper formalises and Turso’s MVCC implements:
begin <= T: the version was committed at or before the reader’s begin-timestamp. (For an in-flight versionbegin = Id(tx), only the producing transaction can see it.)end > Torend is None: the version hasn’t been superseded yet from the reader’s point of view.
Both conditions must hold. See MvStore::visible_at.
Fields§
§begin: TxTimestampOrId§end: Option<TxTimestampOrId>§payload: VersionPayloadImplementations§
Source§impl RowVersion
impl RowVersion
Sourcepub fn committed(commit_ts: u64, payload: VersionPayload) -> Self
pub fn committed(commit_ts: u64, payload: VersionPayload) -> Self
Builds a freshly-committed version at commit_ts with no
end (i.e. currently latest). This is the shape the legacy
commit path produces in 11.4 when it mirrors a row write.
Sourcepub fn in_flight(tx_id: TxId, payload: VersionPayload) -> Self
pub fn in_flight(tx_id: TxId, payload: VersionPayload) -> Self
Builds an in-flight version owned by tx_id. v0 tests use
this to construct chains by hand; the production write path
(11.4) will own it.
Trait Implementations§
Source§impl Clone for RowVersion
impl Clone for RowVersion
Source§fn clone(&self) -> RowVersion
fn clone(&self) -> RowVersion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RowVersion
impl RefUnwindSafe for RowVersion
impl Send for RowVersion
impl Sync for RowVersion
impl Unpin for RowVersion
impl UnsafeUnpin for RowVersion
impl UnwindSafe for RowVersion
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