Struct splinter::error::ResourceTemporarilyUnavailableError [−][src]
pub struct ResourceTemporarilyUnavailableError { /* fields omitted */ }
Expand description
An error which is returned when an underlying resource is unavailable.
This error can be handled by retrying, usually in a loop with a small delay.
Implementations
Constructs a new ResourceTemporarilyUnavailableError
from a specified source error.
The implementation of std::fmt::Display
for this error will simply pass through the
display of the source message unmodified.
Examples
use splinter::error::ResourceTemporarilyUnavailableError;
let io_err = std::io::Error::new(std::io::ErrorKind::Other, "io error");
let rtu_error = ResourceTemporarilyUnavailableError::from_source(Box::new(io_err));
assert_eq!(format!("{}", rtu_error), "io error");
Constructs a new ResourceTemporarilyUnavailableError
from a specified source error with
a retry duration hint.
The hint specified here can be used by the caller as the duration between retry attempts.
Callers may ignore this hint and provide their own algorithms, or may use this Duration
as provided.
The implementation of std::fmt::Display
for this error will simply pass through the
display of the source message unmodified.
Examples
use std::time::Duration;
use splinter::error::ResourceTemporarilyUnavailableError;
let io_err = std::io::Error::new(std::io::ErrorKind::Other, "io error");
let rtu_error = ResourceTemporarilyUnavailableError::from_source_with_hint(Box::new(io_err), Duration::new(10, 0));
assert_eq!(format!("{}", rtu_error), "io error");
Returns the duration which the underlying library provides as a suggestion for an appropriate amount of time between retry attempts.
Trait Implementations
Auto Trait Implementations
impl !Send for ResourceTemporarilyUnavailableError
impl !Sync for ResourceTemporarilyUnavailableError
impl Unpin for ResourceTemporarilyUnavailableError
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Convert self
to an expression for Diesel’s query builder. Read more
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
Convert &self
to an expression for Diesel’s query builder. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more