pub struct ErrorPolicy {
pub decode: FailureAction,
pub rejected: FailureAction,
pub retry_exhausted: FailureAction,
pub encode: FailureAction,
pub publish_rejected: FailureAction,
}Expand description
Failure routing for one subscription.
Defaults never lose a delivery: handler failures (rejection and retry exhaustion) and
rejected publications are dead-lettered, and without a configured dead-letter sink they
stop without ACK. Decode and
encode failures stop by default; choosing DeadLetter for them requires a dead-letter sink,
and the subscription fails validation otherwise.
Fields§
§decode: FailureActionAction after FailureKind::Decode. Defaults to FailureAction::Stop.
rejected: FailureActionAction after FailureKind::Rejected. Defaults to FailureAction::DeadLetter.
retry_exhausted: FailureActionAction after FailureKind::RetryExhausted. Defaults to FailureAction::DeadLetter.
encode: FailureActionAction after FailureKind::Encode. Defaults to FailureAction::Stop.
publish_rejected: FailureActionAction after FailureKind::PublishRejected. Defaults to FailureAction::DeadLetter.
Implementations§
Source§impl ErrorPolicy
impl ErrorPolicy
Sourcepub fn dead_letter_all() -> Self
pub fn dead_letter_all() -> Self
Route every routable failure to the dead-letter sink.
Sourcepub fn action(&self, kind: FailureKind) -> FailureAction
pub fn action(&self, kind: FailureKind) -> FailureAction
The configured action for kind.
Trait Implementations§
Source§impl Clone for ErrorPolicy
impl Clone for ErrorPolicy
Source§impl Debug for ErrorPolicy
impl Debug for ErrorPolicy
Source§impl Default for ErrorPolicy
impl Default for ErrorPolicy
impl Eq for ErrorPolicy
Source§impl PartialEq for ErrorPolicy
impl PartialEq for ErrorPolicy
impl StructuralPartialEq for ErrorPolicy
Auto Trait Implementations§
impl Freeze for ErrorPolicy
impl RefUnwindSafe for ErrorPolicy
impl Send for ErrorPolicy
impl Sync for ErrorPolicy
impl Unpin for ErrorPolicy
impl UnsafeUnpin for ErrorPolicy
impl UnwindSafe for ErrorPolicy
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request