pub struct EpochTracker { /* private fields */ }Expand description
Epoch-based MVCC tracker for concurrent reads during writes
Allows multiple readers to access consistent snapshots while writers make changes. Tracks the minimum epoch across all active readers to determine when old data can be safely reclaimed.
Implementations§
Source§impl EpochTracker
impl EpochTracker
pub fn new() -> Self
Sourcepub fn current_epoch(&self) -> u64
pub fn current_epoch(&self) -> u64
Get the current epoch
Sourcepub fn safe_epoch(&self) -> u64
pub fn safe_epoch(&self) -> u64
Get the safe epoch (minimum across all active readers)
Sourcepub fn begin_write(&self) -> WriteGuard<'_>
pub fn begin_write(&self) -> WriteGuard<'_>
Begin a write operation, incrementing the global epoch
Sourcepub fn begin_read(&self, thread_id: usize) -> ReadGuard<'_>
pub fn begin_read(&self, thread_id: usize) -> ReadGuard<'_>
Begin a read operation on the given thread
Sourcepub fn wait_for_readers(&self, target_epoch: u64)
pub fn wait_for_readers(&self, target_epoch: u64)
Wait until all readers have advanced past the given epoch
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for EpochTracker
impl RefUnwindSafe for EpochTracker
impl Send for EpochTracker
impl Sync for EpochTracker
impl Unpin for EpochTracker
impl UnwindSafe for EpochTracker
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> 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