pub struct RangeLockManager { /* private fields */ }Expand description
Interval-based range lock manager
Uses an interval tree for O(log n) conflict detection.
Implementations§
Source§impl RangeLockManager
impl RangeLockManager
pub fn new() -> Self
Sourcepub fn acquire(
&self,
txn_id: TxnId,
range: KeyRange,
is_write: bool,
) -> Result<(), RangeLockConflict>
pub fn acquire( &self, txn_id: TxnId, range: KeyRange, is_write: bool, ) -> Result<(), RangeLockConflict>
Acquire a range lock for a transaction
Sourcepub fn check_conflict(
&self,
txn_id: TxnId,
range: &KeyRange,
is_write: bool,
) -> Option<TxnId>
pub fn check_conflict( &self, txn_id: TxnId, range: &KeyRange, is_write: bool, ) -> Option<TxnId>
Check for conflicts without acquiring
Sourcepub fn lock_count(&self, txn_id: TxnId) -> usize
pub fn lock_count(&self, txn_id: TxnId) -> usize
Get number of locks held by a transaction
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RangeLockManager
impl !RefUnwindSafe for RangeLockManager
impl Send for RangeLockManager
impl Sync for RangeLockManager
impl Unpin for RangeLockManager
impl UnsafeUnpin for RangeLockManager
impl UnwindSafe for RangeLockManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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