pub struct Error { /* private fields */ }
Expand description
Error is the error struct returned by all opendal functions.
Implementations§
source§impl Error
impl Error
sourcepub fn new(kind: ErrorKind, message: &str) -> Self
pub fn new(kind: ErrorKind, message: &str) -> Self
Create a new Error with error kind and message.
sourcepub fn with_operation(self, operation: impl Into<&'static str>) -> Self
pub fn with_operation(self, operation: impl Into<&'static str>) -> Self
Update error’s operation.
Notes
If the error already carries an operation, we will push a new context
(called, operation)
.
sourcepub fn with_context(self, key: &'static str, value: impl Into<String>) -> Self
pub fn with_context(self, key: &'static str, value: impl Into<String>) -> Self
Add more context in error.
sourcepub fn set_source(self, src: impl Into<Error>) -> Self
pub fn set_source(self, src: impl Into<Error>) -> Self
sourcepub fn set_permanent(self) -> Self
pub fn set_permanent(self) -> Self
Set permanent status for error.
sourcepub fn set_temporary(self) -> Self
pub fn set_temporary(self) -> Self
Set temporary status for error.
By set temporary, we indicate this error is retryable.
sourcepub fn set_persistent(self) -> Self
pub fn set_persistent(self) -> Self
Set persistent status for error.
By setting persistent, we indicate the retry should be stopped.
sourcepub fn is_temporary(&self) -> bool
pub fn is_temporary(&self) -> bool
Check if this error is temporary.
Trait Implementations§
source§impl Error for Error
impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<RedisError> for Error
impl From<RedisError> for Error
source§fn from(e: RedisError) -> Self
fn from(e: RedisError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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