pub enum Delivered {
Accepted,
Rejected {
status: u16,
retry_after: Option<u64>,
},
Unreachable(String),
}Expand description
What happened to one delivery attempt.
Variants§
Accepted
The receiver answered 2xx, which is the acknowledgement the spec asks for.
Rejected
It answered something else.
Fields
retry_after: Option<u64>What the receiver asked to be waited, in seconds, if it said.
A 429 or a 503 with Retry-After is a receiver naming its own
recovery, and a sender that overrides it with a schedule of its own
is choosing to be told twice. Honoured in preference to the
worker’s backoff, and bounded there rather than here.
Unreachable(String)
It did not answer.
Implementations§
Source§impl Delivered
impl Delivered
Sourcepub const fn is_permanent(&self) -> bool
pub const fn is_permanent(&self) -> bool
Whether this answer will still be this answer after a wait.
410 Gone is the one status that means it: the receiver is stating that the resource is permanently absent, which is precisely a webhook endpoint that has been retired. Every other rejection is treated as transient, including 4xx — a 404 during a deploy, a 401 while a credential rotates and a 400 from a receiver mid-upgrade are all answers that change, and abandoning a run’s events on the first of them would lose more than a wasted retry costs.
Sourcepub const fn retry_after(&self) -> Option<u64>
pub const fn retry_after(&self) -> Option<u64>
The receiver’s own advice about when to come back.
Trait Implementations§
impl Eq for Delivered
impl StructuralPartialEq for Delivered
Auto Trait Implementations§
impl Freeze for Delivered
impl RefUnwindSafe for Delivered
impl Send for Delivered
impl Sync for Delivered
impl Unpin for Delivered
impl UnsafeUnpin for Delivered
impl UnwindSafe for Delivered
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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 more