pub enum LockError {
Deadlock {
victim: u64,
cycle: String,
},
DeadlineExceeded,
Cancelled,
InvalidRequest(String),
}Expand description
A failed lock acquisition.
The taxonomy category of each variant is available through
Self::category; conversion to MongrelError maps onto the closest
existing variant (see the module docs for the deadlock mapping).
Variants§
Deadlock
The transaction was chosen as the deterministic deadlock victim; retry the whole transaction.
Fields
DeadlineExceeded
The lock-wait deadline (or the control’s own deadline) expired.
Cancelled
The wait was cancelled through its ExecutionControl.
InvalidRequest(String)
The request violates the usage contract (e.g. a second in-flight wait for the same transaction on the same key).
Implementations§
Source§impl LockError
impl LockError
Sourcepub fn category(&self) -> ErrorCategory
pub fn category(&self) -> ErrorCategory
The stable cross-language taxonomy category of this failure (spec
section 9.7); identical to the category of the MongrelError
produced by the bridge below.
Trait Implementations§
impl Eq for LockError
Source§impl Error for LockError
impl Error for LockError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<LockError> for MongrelError
impl From<LockError> for MongrelError
Source§fn from(error: LockError) -> Self
fn from(error: LockError) -> Self
Maps onto the matching MongrelError variant. A deadlock becomes
MongrelError::Deadlock — victim and cycle preserved — so callers see
the precise ErrorCategory::Deadlock with the same
retry-the-whole-transaction discipline as Conflict.
impl StructuralPartialEq for LockError
Auto Trait Implementations§
impl Freeze for LockError
impl RefUnwindSafe for LockError
impl Send for LockError
impl Sync for LockError
impl Unpin for LockError
impl UnsafeUnpin for LockError
impl UnwindSafe for LockError
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