pub struct Error { /* private fields */ }
Expand description
An error encountered from interfacing with Azure
Implementations§
Source§impl Error
impl Error
Sourcepub fn new<E>(kind: ErrorKind, error: E) -> Error
pub fn new<E>(kind: ErrorKind, error: E) -> Error
Create a new Error
based on a specific error kind and an underlying error cause
Sourcepub fn full<E, C>(kind: ErrorKind, error: E, message: C) -> Error
pub fn full<E, C>(kind: ErrorKind, error: E, message: C) -> Error
Create a new Error
based on a specific error kind and an underlying error cause
along with a message
Sourcepub fn message<C>(kind: ErrorKind, message: C) -> Error
pub fn message<C>(kind: ErrorKind, message: C) -> Error
Create an Error
based on an error kind and some sort of message
Sourcepub fn with_message<F, C>(kind: ErrorKind, message: F) -> Error
pub fn with_message<F, C>(kind: ErrorKind, message: F) -> Error
Creates an Error
based on an error kind and formatted message
Sourcepub fn with_context<F, C>(self, f: F) -> Error
pub fn with_context<F, C>(self, f: F) -> Error
Wrap this error in additional message
Sourcepub fn into_inner(self) -> Result<Box<dyn Error + Send + Sync>, Error>
pub fn into_inner(self) -> Result<Box<dyn Error + Send + Sync>, Error>
Consumes the Error, returning its inner error (if any).
Sourcepub fn into_downcast<T>(self) -> Result<T, Error>where
T: Error + 'static,
pub fn into_downcast<T>(self) -> Result<T, Error>where
T: Error + 'static,
Consumes the error attempting to downcast the inner error as the type provided
Returns Err(self)
if the downcast is not possible
Sourcepub fn get_ref(&self) -> Option<&(dyn Error + Send + Sync + 'static)>
pub fn get_ref(&self) -> Option<&(dyn Error + Send + Sync + 'static)>
Returns a reference to the inner error wrapped by this error (if any).
Sourcepub fn as_http_error(&self) -> Option<&HttpError>
pub fn as_http_error(&self) -> Option<&HttpError>
Cast this error as an HttpError
This searches the entire “source” chain
looking for an HttpError
.
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: Error + 'static,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: Error + 'static,
Returns a reference to the inner error (if any) downcasted to the type provided
Sourcepub fn get_mut(&mut self) -> Option<&mut (dyn Error + Send + Sync + 'static)>
pub fn get_mut(&mut self) -> Option<&mut (dyn Error + Send + Sync + 'static)>
Returns a mutable reference to the inner error wrapped by this error (if any).
Sourcepub fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: Error + 'static,
pub fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: Error + 'static,
Returns a mutable reference to the inner error (if any) downcasted to the type provided