pub enum LockMode {
KeyShare,
Share,
NoKeyUpdate,
Exclusive,
}Expand description
A PG tuple-lock strength. FOR KEY SHARE / FOR SHARE / FOR NO KEY UPDATE / FOR UPDATE, plus the implicit modes a write takes:
a key-touching UPDATE or any DELETE takes Exclusive; a non-key
UPDATE takes NoKeyUpdate.
Variants§
Implementations§
Source§impl LockMode
impl LockMode
Sourcepub fn conflicts_with(self, requested: LockMode) -> bool
pub fn conflicts_with(self, requested: LockMode) -> bool
PG tuple-lock conflict matrix. held.conflicts_with(requested)
is true iff a currently-held lock in mode self blocks a new
request in mode requested.
held \ req KeyShare Share NoKeyUpd Excl
KeyShare ok ok ok X
Share ok ok X X
NoKeyUpdate ok X X X
Exclusive X X X XTrait Implementations§
impl Copy for LockMode
impl Eq for LockMode
Source§impl Ord for LockMode
impl Ord for LockMode
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for LockMode
impl PartialOrd for LockMode
impl StructuralPartialEq for LockMode
Auto Trait Implementations§
impl Freeze for LockMode
impl RefUnwindSafe for LockMode
impl Send for LockMode
impl Sync for LockMode
impl Unpin for LockMode
impl UnsafeUnpin for LockMode
impl UnwindSafe for LockMode
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