pub struct RetryConfig {
pub max_attempts: u32,
pub base_delay_ms: u64,
pub max_delay_ms: u64,
pub replay_cap_bytes: usize,
pub retry_on_status: Vec<u16>,
pub retry_on_error: bool,
pub idempotent_only: bool,
pub budget: Option<BudgetConfig>,
}Expand description
Typed config surface for the retry middleware.
Fields§
§max_attempts: u32Total attempts (>= 1). Defaults to 3.
base_delay_ms: u64Base backoff delay in ms. Defaults to 50.
max_delay_ms: u64Backoff ceiling in ms. Defaults to 2000.
replay_cap_bytes: usizeReplay buffer cap in bytes for request-body replay across attempts.
retry_on_status: Vec<u16>Status codes that trigger a retry.
retry_on_error: boolRetry on any inner error.
idempotent_only: boolOnly retry idempotent requests.
budget: Option<BudgetConfig>Optional retry budget. Presence enables it (defaults when fields omitted).
Implementations§
Source§impl RetryConfig
impl RetryConfig
Sourcepub fn builder() -> RetryConfigBuilder
pub fn builder() -> RetryConfigBuilder
Create an instance of RetryConfig using the builder syntax
Source§impl RetryConfig
impl RetryConfig
Sourcepub fn from_config(
self,
inner: PipeHandle,
) -> Result<Retry<PipeHandle, TimeClock>, ProximaError>
pub fn from_config( self, inner: PipeHandle, ) -> Result<Retry<PipeHandle, TimeClock>, ProximaError>
Materialise the retry middleware around inner, on the production
TimeClock.
Trait Implementations§
Source§impl Clone for RetryConfig
impl Clone for RetryConfig
Source§impl Debug for RetryConfig
impl Debug for RetryConfig
Source§impl<'de> Deserialize<'de> for RetryConfig
impl<'de> Deserialize<'de> for RetryConfig
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 Serialize for RetryConfig
impl Serialize for RetryConfig
Source§impl Settings for RetryConfig
impl Settings for RetryConfig
Source§const PREFIX: Option<&'static str>
const PREFIX: Option<&'static str>
The struct’s own prefix, used only when it is the root of resolution.
When embedded as a nested field, the embedding field decides the prefix.
Source§fn from_env_with_prefix(__prefix: &str) -> Result<Self>
fn from_env_with_prefix(__prefix: &str) -> Result<Self>
Resolve using
prefix as the accumulated root instead of PREFIX.
Used by parent structs to push their namespace into nested fields.Source§fn override_from_env(&mut self) -> Result<()>
fn override_from_env(&mut self) -> Result<()>
Overwrite only the fields whose env keys are currently set, leaving the
rest untouched. Useful for layering env over file-loaded defaults.
Source§fn override_from_env_with_prefix(&mut self, __prefix: &str) -> Result<()>
fn override_from_env_with_prefix(&mut self, __prefix: &str) -> Result<()>
override_from_env with an explicit accumulated prefix.Source§impl Validate for RetryConfig
Available on crate feature std only.
impl Validate for RetryConfig
Available on crate feature
std only.Auto Trait Implementations§
impl Freeze for RetryConfig
impl RefUnwindSafe for RetryConfig
impl Send for RetryConfig
impl Sync for RetryConfig
impl Unpin for RetryConfig
impl UnsafeUnpin for RetryConfig
impl UnwindSafe for RetryConfig
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