pub enum StorageError {
Show 13 variants
NotFound {
id: String,
},
AlreadyExists {
id: String,
},
Validation {
message: String,
},
Connection {
message: String,
},
Query {
message: String,
},
Timeout {
duration_ms: u64,
},
SimulatedFault {
fault_type: String,
},
Internal {
message: String,
},
ConnectionFailed(String),
WriteFailed(String),
ReadFailed(String),
SerializationError(String),
DeserializationError(String),
}Expand description
Errors from storage operations.
Variants§
NotFound
Entity not found
AlreadyExists
Entity already exists (for insert-only operations)
Validation
Validation error
Connection
Connection error
Query
Query error
Timeout
Timeout error
SimulatedFault
Simulated fault (for DST)
Internal
Internal error
ConnectionFailed(String)
Connection failed
WriteFailed(String)
Write failed
ReadFailed(String)
Read failed
SerializationError(String)
Serialization error
DeserializationError(String)
Deserialization error
Implementations§
Source§impl StorageError
impl StorageError
Sourcepub fn already_exists(id: impl Into<String>) -> Self
pub fn already_exists(id: impl Into<String>) -> Self
Create an already exists error.
Sourcepub fn validation(message: impl Into<String>) -> Self
pub fn validation(message: impl Into<String>) -> Self
Create a validation error.
Sourcepub fn connection(message: impl Into<String>) -> Self
pub fn connection(message: impl Into<String>) -> Self
Create a connection error.
Sourcepub fn simulated_fault(fault_type: impl Into<String>) -> Self
pub fn simulated_fault(fault_type: impl Into<String>) -> Self
Create a simulated fault error.
Sourcepub fn read(message: impl Into<String>) -> Self
pub fn read(message: impl Into<String>) -> Self
Create a read error (wraps query error for reads).
Sourcepub fn write(message: impl Into<String>) -> Self
pub fn write(message: impl Into<String>) -> Self
Create a write error (wraps query error for writes).
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Check if this is a transient error (can be retried).
Trait Implementations§
Source§impl Clone for StorageError
impl Clone for StorageError
Source§fn clone(&self) -> StorageError
fn clone(&self) -> StorageError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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
1.30.0 · 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()
Source§impl From<StorageError> for MemoryError
impl From<StorageError> for MemoryError
Source§fn from(err: StorageError) -> Self
fn from(err: StorageError) -> Self
Converts to this type from the input type.
Source§impl From<StorageError> for RetrievalError
impl From<StorageError> for RetrievalError
Source§fn from(err: StorageError) -> Self
fn from(err: StorageError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for StorageError
impl RefUnwindSafe for StorageError
impl Send for StorageError
impl Sync for StorageError
impl Unpin for StorageError
impl UnwindSafe 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