pub struct RetryPolicy {
pub attempts: NonZeroU32,
pub schedule: Schedule,
pub on: Vec<Condition>,
}Expand description
retry = { attempts, schedule, on }. attempts is the TOTAL attempt
budget (first call included) — zero is unrepresentable by type.
Fields§
§attempts: NonZeroU32§schedule: Schedule§on: Vec<Condition>Implementations§
Source§impl RetryPolicy
impl RetryPolicy
pub const DEFAULT_ATTEMPTS: NonZeroU32
Sourcepub fn default_on() -> Vec<Condition>
pub fn default_on() -> Vec<Condition>
The contract default retryable set: ["conn", "timeout", "429", "5xx"].
pub fn is_retryable(&self, class: ErrorClass, http_status: Option<u16>) -> bool
Trait Implementations§
Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
Source§fn clone(&self) -> RetryPolicy
fn clone(&self) -> RetryPolicy
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 RetryPolicy
impl Debug for RetryPolicy
Source§impl Default for RetryPolicy
impl Default for RetryPolicy
Source§impl<'de> Deserialize<'de> for RetryPolicywhere
RetryPolicy: Default,
impl<'de> Deserialize<'de> for RetryPolicywhere
RetryPolicy: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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 UnsafeUnpin 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
Mutably borrows from an owned value. Read more