#[non_exhaustive]pub enum LockError {
Poisoned(String),
AcquireFailed(String),
ReleaseFailed(String),
Expired(String),
Busy(String),
Other(String),
}Expand description
Error type for lock operations.
Each variant carries a retry classification via LockError::kind:
contention and lease loss are transient (retry the acquire), whereas a
poisoned primitive is a process-fatal invariant violation that retrying
cannot clear.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Poisoned(String)
The underlying lock primitive was poisoned (e.g. a thread panicked while holding it).
AcquireFailed(String)
Failed to acquire the lock.
ReleaseFailed(String)
Failed to release the lock.
Expired(String)
The lock expired (e.g. a distributed lock TTL elapsed).
Busy(String)
A transient backend condition (e.g. SQLite SQLITE_BUSY/SQLITE_LOCKED
or a pool-acquire timeout) prevented the operation. Retrying may succeed.
Other(String)
Any other lock error.
Implementations§
Source§impl LockError
impl LockError
Sourcepub fn kind(&self) -> RetryClass
pub fn kind(&self) -> RetryClass
Classify this error for retry purposes.
Poisoned is permanent — a poisoned primitive signals a broken invariant
that a retry cannot clear. Contention (AcquireFailed, Busy), lease
loss (Expired), and transient release failures are retryable. Other
is conservatively retryable: an unclassified lock failure is more often
transient infrastructure than a deterministic bug, and at-least-once
semantics make a redundant retry safe.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether this error is retryable.
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 RepositoryError
impl From<LockError> for RepositoryError
Source§impl From<LockError> for TableStoreError
impl From<LockError> for TableStoreError
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> AggregateBuilder for T
impl<T> AggregateBuilder for T
fn aggregate<A: Aggregate>(self) -> AggregateRepository<Self, A>
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> Queueable for T
impl<T> Queueable for T
Source§fn queued(self) -> QueuedRepository<Self, InMemoryLockManager>
fn queued(self) -> QueuedRepository<Self, InMemoryLockManager>
.aggregate::<T>() for per-aggregate serialization over the async
repository surface.