pub enum StorageError {
NotFound(String),
PermissionDenied(String),
Io(Error),
InvalidKey(String),
Backend(String),
Timeout(String),
Other(Error),
}Expand description
Errors that can occur during storage operations
Variants§
NotFound(String)
Object not found in storage
PermissionDenied(String)
Permission denied for the requested operation
Io(Error)
I/O error occurred
InvalidKey(String)
Invalid key format (empty, contains invalid characters, etc.)
Backend(String)
Storage backend not available or misconfigured
Timeout(String)
Operation timed out
Other(Error)
Transparent error delegation for wrapped error types
This variant allows wrapping other error types (like anyhow::Error) while forwarding their Display and source implementations transparently. Useful for catch-all error handling and opaque error types.
Implementations§
Source§impl StorageError
impl StorageError
Sourcepub fn permission_denied<S: Into<String>>(msg: S) -> Self
pub fn permission_denied<S: Into<String>>(msg: S) -> Self
Create a PermissionDenied error with context
Sourcepub fn invalid_key<S: Into<String>>(msg: S) -> Self
pub fn invalid_key<S: Into<String>>(msg: S) -> Self
Create an InvalidKey error with context
Sourcepub fn other<E: Into<Error>>(error: E) -> Self
pub fn other<E: Into<Error>>(error: E) -> Self
Create a generic error from any error type that can convert to anyhow::Error
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Check if this is a NotFound error
Sourcepub fn is_permission_denied(&self) -> bool
pub fn is_permission_denied(&self) -> bool
Check if this is a PermissionDenied error
Sourcepub fn is_invalid_key(&self) -> bool
pub fn is_invalid_key(&self) -> bool
Check if this is an InvalidKey error
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<Error> for StorageError
impl From<Error> for StorageError
Auto Trait Implementations§
impl Freeze for StorageError
impl !RefUnwindSafe for StorageError
impl Send for StorageError
impl Sync for StorageError
impl Unpin for StorageError
impl UnsafeUnpin 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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