pub struct OptimisticVersion { /* private fields */ }Expand description
Optimistic concurrency control for HNSW nodes Uses version counters instead of locks for wait-free reads
Implementations§
Source§impl OptimisticVersion
impl OptimisticVersion
pub fn new() -> Self
Sourcepub fn read_version(&self) -> u64
pub fn read_version(&self) -> u64
Read the version (for optimistic read)
Sourcepub fn try_write_begin(&self) -> Option<WriteGuard<'_>>
pub fn try_write_begin(&self) -> Option<WriteGuard<'_>>
Try to begin a write (returns None if concurrent write in progress)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for OptimisticVersion
impl RefUnwindSafe for OptimisticVersion
impl Send for OptimisticVersion
impl Sync for OptimisticVersion
impl Unpin for OptimisticVersion
impl UnwindSafe for OptimisticVersion
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