#[non_exhaustive]pub enum RowLock {
ForUpdate,
ForShare,
ForUpdateSkipLocked,
ForShareSkipLocked,
NoKeyUpdate,
KeyShare,
}Expand description
事务 SELECT 的行锁模式。
锁模式只能交给 MySQL/PostgreSQL 的 Transaction::select_locked 或便捷方法使用;
普通 QueryBuilder 不暴露加锁入口,避免锁语句在自动提交连接上失去预期语义。
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ForUpdate
排他行锁:FOR UPDATE。
共享行锁:FOR SHARE。
ForUpdateSkipLocked
排他行锁并跳过已锁定行:FOR UPDATE SKIP LOCKED。
共享行锁并跳过已锁定行:FOR SHARE SKIP LOCKED。
NoKeyUpdate
排他行锁,但不禁外键引用:FOR NO KEY UPDATE(PostgreSQL)。
键共享锁:FOR KEY SHARE(PostgreSQL)。
Trait Implementations§
impl Copy for RowLock
impl Eq for RowLock
impl StructuralPartialEq for RowLock
Auto Trait Implementations§
impl Forget for RowLock
impl Freeze for RowLock
impl Move for RowLock
impl RefUnwindSafe for RowLock
impl Send for RowLock
impl Sync for RowLock
impl Unpin for RowLock
impl UnsafeUnpin for RowLock
impl UnwindSafe for RowLock
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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