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
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<DecodeError> for Error
impl From<DecodeError> for Error
Source§fn from(error: DecodeError) -> Self
fn from(error: DecodeError) -> Self
Source§impl From<FromUtf8Error> for Error
impl From<FromUtf8Error> for Error
Source§fn from(error: FromUtf8Error) -> Self
fn from(error: FromUtf8Error) -> Self
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(error: ParseError) -> Self
fn from(error: ParseError) -> Self
Auto Trait Implementations§
impl Freeze for Error
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
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.