pub struct Lock {
pub strength: Option<LockStrength>,
pub tables: Vec<Cow<'static, str>>,
pub wait: Option<LockWait>,
}Expand description
FOR <strength> [OF table, …] [NOWAIT | SKIP LOCKED]
From PostgreSQL 17:
FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE }
[ OF table_name [, ...] ] [ NOWAIT | SKIP LOCKED ]Never contributes a bound argument: the OF list is table names.
Fields§
§strength: Option<LockStrength>How strong a lock. None is how a default-constructed lock stays absent —
there is no FOR clause without a strength.
tables: Vec<Cow<'static, str>>Restrict the lock to these tables of the statement. Quoted.
wait: Option<LockWait>What to do when a row is already locked. The default is to wait.
Implementations§
Source§impl Lock
impl Lock
Sourcepub fn new(strength: LockStrength) -> Self
pub fn new(strength: LockStrength) -> Self
A lock of strength over every table in the statement.
Sourcepub fn append_table(
&mut self,
tables: impl IntoIterator<Item = impl Into<Cow<'static, str>>>,
)
pub fn append_table( &mut self, tables: impl IntoIterator<Item = impl Into<Cow<'static, str>>>, )
Restrict the lock to these tables.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Lock
impl RefUnwindSafe for Lock
impl Send for Lock
impl Sync for Lock
impl Unpin for Lock
impl UnsafeUnpin for Lock
impl UnwindSafe for Lock
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