pub enum StorageError {
NotFound {
capability: StorageCapability,
resource: &'static str,
key: String,
},
AlreadyExists {
capability: StorageCapability,
resource: &'static str,
key: String,
},
Conflict {
capability: StorageCapability,
operation: Cow<'static, str>,
message: String,
},
InvalidInput {
capability: StorageCapability,
operation: Cow<'static, str>,
message: String,
},
Unsupported {
capability: StorageCapability,
operation: Cow<'static, str>,
message: String,
},
Pool {
operation: Cow<'static, str>,
message: String,
},
Timeout {
operation: Cow<'static, str>,
},
Transaction {
operation: Cow<'static, str>,
message: String,
},
Serialization {
capability: StorageCapability,
message: String,
},
IndexMaintenance {
capability: StorageCapability,
message: String,
},
Driver {
capability: StorageCapability,
operation: Cow<'static, str>,
source: Box<dyn StdError + Send + Sync>,
},
}Expand description
Unified error type for all storage operations.
Variants§
NotFound
AlreadyExists
Conflict
InvalidInput
Unsupported
Pool
Timeout
Transaction
Serialization
IndexMaintenance
Driver
Implementations§
Source§impl StorageError
impl StorageError
Sourcepub fn driver(
capability: StorageCapability,
operation: impl Into<Cow<'static, str>>,
source: impl StdError + Send + Sync + 'static,
) -> Self
pub fn driver( capability: StorageCapability, operation: impl Into<Cow<'static, str>>, source: impl StdError + Send + Sync + 'static, ) -> Self
Construct a Driver error wrapping a backend-specific error source.
Sourcepub fn capability(&self) -> Option<StorageCapability>
pub fn capability(&self) -> Option<StorageCapability>
Return the storage capability surface that produced this error, if any.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether this error is transient and the operation may succeed on retry.
Trait Implementations§
Source§impl Debug for StorageError
impl Debug for StorageError
Source§impl Display for StorageError
impl Display for StorageError
Source§impl Error for StorageError
impl Error for StorageError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for StorageError
impl !UnwindSafe for StorageError
impl Freeze for StorageError
impl Send for StorageError
impl Sync for StorageError
impl Unpin for StorageError
impl UnsafeUnpin for StorageError
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