pub struct VersionInfo {
pub created_epoch: EpochId,
pub deleted_epoch: Option<EpochId>,
pub created_by: TxId,
}Expand description
Visibility information for a version.
Fields§
§created_epoch: EpochIdThe epoch this version was created in.
deleted_epoch: Option<EpochId>The epoch this version was deleted in (if any).
created_by: TxIdThe transaction that created this version.
Implementations§
Source§impl VersionInfo
impl VersionInfo
Sourcepub fn new(created_epoch: EpochId, created_by: TxId) -> VersionInfo
pub fn new(created_epoch: EpochId, created_by: TxId) -> VersionInfo
Creates a new version info.
Sourcepub fn mark_deleted(&mut self, epoch: EpochId)
pub fn mark_deleted(&mut self, epoch: EpochId)
Marks this version as deleted.
Sourcepub fn is_visible_at(&self, epoch: EpochId) -> bool
pub fn is_visible_at(&self, epoch: EpochId) -> bool
Checks if this version is visible at the given epoch.
Sourcepub fn is_visible_to(&self, viewing_epoch: EpochId, viewing_tx: TxId) -> bool
pub fn is_visible_to(&self, viewing_epoch: EpochId, viewing_tx: TxId) -> bool
Checks if this version is visible to a specific transaction.
A version is visible to a transaction if:
- It was created by the same transaction, OR
- It was created in an epoch before the transaction’s start epoch and not deleted before that epoch
Trait Implementations§
Source§impl Clone for VersionInfo
impl Clone for VersionInfo
Source§fn clone(&self) -> VersionInfo
fn clone(&self) -> VersionInfo
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 VersionInfo
impl Debug for VersionInfo
impl Copy for VersionInfo
Auto Trait Implementations§
impl Freeze for VersionInfo
impl RefUnwindSafe for VersionInfo
impl Send for VersionInfo
impl Sync for VersionInfo
impl Unpin for VersionInfo
impl UnwindSafe for VersionInfo
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