pub struct Snapshot {
pub xid: u64,
pub in_progress: HashSet<u64>,
}Expand description
Immutable snapshot taken at transaction start or statement start.
Callers evaluate UnifiedEntity::is_visible(snapshot.xid) on every
row returned from storage to filter out rows created by concurrent
transactions that hadn’t committed when the snapshot was taken.
Fields§
§xid: u64The snapshot’s xid — every row with xmin <= xid created before
the snapshot is visible (assuming xmax hasn’t passed).
in_progress: HashSet<u64>Transactions that were still active when the snapshot was taken.
Their writes must be hidden even when xmin <= xid, because
the writer hadn’t committed yet from this snapshot’s point of view.
Implementations§
Source§impl Snapshot
impl Snapshot
Sourcepub fn sees(&self, xmin: u64, xmax: u64) -> bool
pub fn sees(&self, xmin: u64, xmax: u64) -> bool
Is a row with this xmin/xmax visible under this snapshot?
Delegates to super::visibility::is_visible — the deep
module that owns the full MVCC visibility predicate. The
aborted argument is empty here because Snapshot does not
carry the manager-level aborted set; callers that need the
rolled-back-writer rule should consult SnapshotManager
directly, or evolve Snapshot to embed an aborted view.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Snapshot
impl RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnsafeUnpin for Snapshot
impl UnwindSafe for Snapshot
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
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>
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>
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>
T in a tonic::Request