pub enum DeliveryError {
Request(RequestError),
Signing(String),
Unavailable(String),
Held {
retry_after: Duration,
},
Status {
status: u16,
retry_after: Option<Duration>,
body: String,
},
}Expand description
Why a delivery did not go through.
Variants§
Request(RequestError)
The request was not answered, or was refused before it was sent.
Signing(String)
The request could not be signed.
Something the delivery needs from the application, such as the sender’s key, could not be read just now.
Held
It was not sent: its destination has failed too often in a row, and the circuit breaker holds deliveries to it until its cool-off ends.
Status
The inbox answered with a status other than success.
Implementations§
Source§impl DeliveryError
impl DeliveryError
Sourcepub fn is_permanent(&self) -> bool
pub fn is_permanent(&self) -> bool
Whether trying again later cannot help.
A 4xx says the request itself is wrong, except 408 and 429, which say it came at a bad time. A refused address or URL stays refused. Anything else — 5xx, a timeout, a broken connection — may pass.
Sourcepub fn is_permanent_by(&self, permanent: fn(u16) -> bool) -> bool
pub fn is_permanent_by(&self, permanent: fn(u16) -> bool) -> bool
DeliveryError::is_permanent, with permanent saying which
statuses are.
Sourcepub fn retry_after(&self) -> Option<Duration>
pub fn retry_after(&self) -> Option<Duration>
How long the inbox asked to be left alone, or the circuit breaker holds it.
Trait Implementations§
Source§impl Debug for DeliveryError
impl Debug for DeliveryError
Source§impl Display for DeliveryError
impl Display for DeliveryError
Source§impl Error for DeliveryError
impl Error for DeliveryError
1.30.0 · 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
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for DeliveryError
impl !UnwindSafe for DeliveryError
impl Freeze for DeliveryError
impl Send for DeliveryError
impl Sync for DeliveryError
impl Unpin for DeliveryError
impl UnsafeUnpin for DeliveryError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.