pub struct Error { /* private fields */ }Expand description
One error type for the whole client. Constructing one without a source does not allocate.
Implementations§
Source§impl Error
impl Error
pub fn with_source( kind: ErrorKind, recovery: Recovery, source: impl Into<Box<dyn StdError + Send + Sync>>, ) -> Self
Sourcepub fn connect(source: impl Into<Box<dyn StdError + Send + Sync>>) -> Self
pub fn connect(source: impl Into<Box<dyn StdError + Send + Sync>>) -> Self
Connect failure: the request was never sent.
pub fn dns(source: impl Into<Box<dyn StdError + Send + Sync>>) -> Self
Sourcepub fn tls(source: impl Into<Box<dyn StdError + Send + Sync>>) -> Self
pub fn tls(source: impl Into<Box<dyn StdError + Send + Sync>>) -> Self
TLS failure that will not fix itself on retry (bad certificate, config).
pub fn io(source: impl Into<Box<dyn StdError + Send + Sync>>) -> Self
pub fn protocol(source: impl Into<Box<dyn StdError + Send + Sync>>) -> Self
pub fn invalid_request( source: impl Into<Box<dyn StdError + Send + Sync>>, ) -> Self
pub const fn timeout() -> Self
pub const fn canceled() -> Self
pub const fn closed() -> Self
pub const fn pool_timeout() -> Self
Sourcepub fn unprocessed(
kind: ErrorKind,
source: impl Into<Box<dyn StdError + Send + Sync>>,
) -> Self
pub fn unprocessed( kind: ErrorKind, source: impl Into<Box<dyn StdError + Send + Sync>>, ) -> Self
Guaranteed-unprocessed failure of the given kind.
Sourcepub fn retryable(
kind: ErrorKind,
source: impl Into<Box<dyn StdError + Send + Sync>>,
) -> Self
pub fn retryable( kind: ErrorKind, source: impl Into<Box<dyn StdError + Send + Sync>>, ) -> Self
Possibly-processed failure of the given kind.
Sourcepub fn with_recovery(self, recovery: Recovery) -> Self
pub fn with_recovery(self, recovery: Recovery) -> Self
Overrides the recovery classification.
pub const fn kind(&self) -> ErrorKind
pub const fn recovery(&self) -> Recovery
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + 'static)>
Returns 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()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Forget for Error
impl Freeze for Error
impl Move for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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