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) -> Self
pub fn new<E>(kind: ErrorKind, error: E) -> Self
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) -> Self
pub fn full<E, C>(kind: ErrorKind, error: E, message: C) -> Self
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) -> Self
pub fn message<C>(kind: ErrorKind, message: C) -> Self
Create an Error
based on an error kind and some sort of message
sourcepub fn with_message<F, C>(kind: ErrorKind, message: F) -> Self
pub fn with_message<F, C>(kind: ErrorKind, message: F) -> Self
Creates an Error
based on an error kind and formatted message
sourcepub fn with_context<F, C>(self, f: F) -> Self
pub fn with_context<F, C>(self, f: F) -> Self
Wrap this error in additional message
sourcepub fn into_inner(self) -> Result<Box<dyn Error + Send + Sync>, Self>
pub fn into_inner(self) -> Result<Box<dyn Error + Send + Sync>, Self>
Consumes the Error, returning its inner error (if any).
sourcepub fn into_downcast<T: Error + 'static>(self) -> Result<T, Self>
pub fn into_downcast<T: Error + 'static>(self) -> Result<T, Self>
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: Error + 'static>(&self) -> Option<&T>
pub fn downcast_ref<T: Error + 'static>(&self) -> Option<&T>
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: Error + 'static>(&mut self) -> Option<&mut T>
pub fn downcast_mut<T: Error + 'static>(&mut self) -> Option<&mut T>
Returns a mutable reference to the inner error (if any) downcasted to the type provided