pub struct MailOutboxRetryPolicy {
pub max_attempts: i32,
pub max_error_len: usize,
}Expand description
Retry and truncation policy for an outbox dispatcher.
Fields§
§max_attempts: i32Maximum number of delivery attempts before permanent failure.
max_error_len: usizeMaximum stored error string length, counted in Unicode scalar values.
Implementations§
Source§impl MailOutboxRetryPolicy
impl MailOutboxRetryPolicy
Sourcepub const fn should_permanently_fail(&self, attempt_count: i32) -> bool
pub const fn should_permanently_fail(&self, attempt_count: i32) -> bool
Returns whether attempt_count should permanently fail.
Sourcepub const fn retry_delay_secs(&self, attempt_count: i32) -> i64
pub const fn retry_delay_secs(&self, attempt_count: i32) -> i64
Returns the delay before the next delivery retry.
Sourcepub fn truncate_error(&self, error: &str) -> String
pub fn truncate_error(&self, error: &str) -> String
Truncates a delivery error according to this policy.
Sourcepub fn delivery_failure_decision(
&self,
attempt_count: i32,
error: impl AsRef<str>,
) -> MailOutboxDeliveryFailureDecision
pub fn delivery_failure_decision( &self, attempt_count: i32, error: impl AsRef<str>, ) -> MailOutboxDeliveryFailureDecision
Classifies a failed delivery attempt.
attempt_count should be the post-delivery attempt count that the
product crate will persist on the outbox row.
Trait Implementations§
Source§impl Clone for MailOutboxRetryPolicy
impl Clone for MailOutboxRetryPolicy
Source§fn clone(&self) -> MailOutboxRetryPolicy
fn clone(&self) -> MailOutboxRetryPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MailOutboxRetryPolicy
impl Debug for MailOutboxRetryPolicy
Source§impl PartialEq for MailOutboxRetryPolicy
impl PartialEq for MailOutboxRetryPolicy
Source§fn eq(&self, other: &MailOutboxRetryPolicy) -> bool
fn eq(&self, other: &MailOutboxRetryPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for MailOutboxRetryPolicy
impl StructuralPartialEq for MailOutboxRetryPolicy
Auto Trait Implementations§
impl Freeze for MailOutboxRetryPolicy
impl RefUnwindSafe for MailOutboxRetryPolicy
impl Send for MailOutboxRetryPolicy
impl Sync for MailOutboxRetryPolicy
impl Unpin for MailOutboxRetryPolicy
impl UnsafeUnpin for MailOutboxRetryPolicy
impl UnwindSafe for MailOutboxRetryPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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