pub enum LockKey {
Row {
table_id: u64,
row_id: RowId,
},
Key {
table_id: u64,
key: Vec<u8>,
},
Range {
table_id: u64,
low: Bound<Vec<u8>>,
high: Bound<Vec<u8>>,
},
Barrier {
name: String,
},
}Expand description
A typed, lockable key.
The families cover the three key spaces of spec section 10.2: row keys
(physical RowId or primary-key bytes), predicate/range keys, and named
barriers for schema/DDL and sequence allocation.
Variants§
Row
One physical row of a table (SELECT ... FOR UPDATE).
Key
One primary-key or unique-constraint key of a table. Callers with
several key spaces per table (multiple unique indexes) MUST fold the
index identity into key, since the manager compares bytes only.
Range
One predicate/range over a table’s key space (serializable predicate protection).
Barrier
A named barrier (schema/DDL, sequence allocation). Names are compared as strings; constructors below define the engine’s namespaces.
Implementations§
Source§impl LockKey
impl LockKey
Sourcepub fn row(table_id: u64, row_id: RowId) -> Self
pub fn row(table_id: u64, row_id: RowId) -> Self
A physical-row key (spec section 10.2 SELECT ... FOR UPDATE).
Sourcepub fn key(table_id: u64, key: impl Into<Vec<u8>>) -> Self
pub fn key(table_id: u64, key: impl Into<Vec<u8>>) -> Self
A primary-key or unique-constraint key from encoded key bytes.
Sourcepub fn range(table_id: u64, low: Bound<Vec<u8>>, high: Bound<Vec<u8>>) -> Self
pub fn range(table_id: u64, low: Bound<Vec<u8>>, high: Bound<Vec<u8>>) -> Self
A predicate/range key over a table’s key space.
Sourcepub fn schema_barrier() -> Self
pub fn schema_barrier() -> Self
The schema/DDL barrier: DDL takes it in Exclusive mode, DML transactions in Shared mode, so schema changes exclude concurrent DML and one another.
Sourcepub fn sequence_barrier(sequence: &str) -> Self
pub fn sequence_barrier(sequence: &str) -> Self
The barrier guarding allocation of one named sequence; always taken in Exclusive mode so concurrent allocations serialize.
Trait Implementations§
impl Eq for LockKey
impl StructuralPartialEq for LockKey
Auto Trait Implementations§
impl Freeze for LockKey
impl RefUnwindSafe for LockKey
impl Send for LockKey
impl Sync for LockKey
impl Unpin for LockKey
impl UnsafeUnpin for LockKey
impl UnwindSafe for LockKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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