#[non_exhaustive]pub struct RetryPolicy {
pub minimum_backoff: Option<Duration>,
pub maximum_backoff: Option<Duration>,
/* private fields */
}Expand description
A policy that specifies how Pub/Sub retries message delivery.
Retry delay will be exponential based on provided minimum and maximum backoffs. https://en.wikipedia.org/wiki/Exponential_backoff.
RetryPolicy will be triggered on NACKs or acknowledgment deadline exceeded events for a given message.
Retry Policy is implemented on a best effort basis. At times, the delay between consecutive deliveries may not match the configuration. That is, delay can be more or less than configured backoff.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.minimum_backoff: Option<Duration>Optional. The minimum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 10 seconds.
maximum_backoff: Option<Duration>Optional. The maximum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 600 seconds.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
pub fn new() -> Self
Sourcepub fn set_minimum_backoff<T>(self, v: T) -> Self
pub fn set_minimum_backoff<T>(self, v: T) -> Self
Sets the value of minimum_backoff.
§Example
use wkt::Duration;
let x = RetryPolicy::new().set_minimum_backoff(Duration::default()/* use setters */);Sourcepub fn set_or_clear_minimum_backoff<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_minimum_backoff<T>(self, v: Option<T>) -> Self
Sets or clears the value of minimum_backoff.
§Example
use wkt::Duration;
let x = RetryPolicy::new().set_or_clear_minimum_backoff(Some(Duration::default()/* use setters */));
let x = RetryPolicy::new().set_or_clear_minimum_backoff(None::<Duration>);Sourcepub fn set_maximum_backoff<T>(self, v: T) -> Self
pub fn set_maximum_backoff<T>(self, v: T) -> Self
Sets the value of maximum_backoff.
§Example
use wkt::Duration;
let x = RetryPolicy::new().set_maximum_backoff(Duration::default()/* use setters */);Sourcepub fn set_or_clear_maximum_backoff<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_maximum_backoff<T>(self, v: Option<T>) -> Self
Sets or clears the value of maximum_backoff.
§Example
use wkt::Duration;
let x = RetryPolicy::new().set_or_clear_maximum_backoff(Some(Duration::default()/* use setters */));
let x = RetryPolicy::new().set_or_clear_maximum_backoff(None::<Duration>);Trait Implementations§
Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
Source§fn clone(&self) -> RetryPolicy
fn clone(&self) -> RetryPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RetryPolicy
impl Debug for RetryPolicy
Source§impl Default for RetryPolicy
impl Default for RetryPolicy
Source§fn default() -> RetryPolicy
fn default() -> RetryPolicy
Source§impl Message for RetryPolicy
impl Message for RetryPolicy
Source§impl PartialEq for RetryPolicy
impl PartialEq for RetryPolicy
impl StructuralPartialEq for RetryPolicy
Auto Trait Implementations§
impl Freeze for RetryPolicy
impl RefUnwindSafe for RetryPolicy
impl Send for RetryPolicy
impl Sync for RetryPolicy
impl Unpin for RetryPolicy
impl UnwindSafe for RetryPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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