pub struct RetryPolicy {
pub max_retries: u32,
pub retry_timeouts: bool,
pub backoff_base_ms: u64,
pub backoff_max_ms: u64,
}Expand description
Retry policy — driver-side scheduling, not a kernel fact. The retryability judgment lives here because interpreting error kinds is loop policy.
Fields§
§max_retries: u32Retries allowed per model round after the first failed attempt;
0 (the default) disables retrying entirely.
retry_timeouts: boolWhether TimedOut model errors are retried (Transient errors
always are). Default false.
backoff_base_ms: u64Backoff base before the first retry, in milliseconds. 0 = no
backoff (retry immediately).
backoff_max_ms: u64Backoff ceiling, in milliseconds.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub fn allows(&self, kind: &ModelInvokeErrorKind) -> bool
pub fn allows(&self, kind: &ModelInvokeErrorKind) -> bool
Whether this policy schedules a further attempt for the error kind.
Sourcepub fn backoff_delay(&self, next_attempt: u32) -> Duration
pub fn backoff_delay(&self, next_attempt: u32) -> Duration
Wait before the (1-based) next_attempt fires:
min(base * 2^(next-2), max) with ±20% jitter, shared by the
invoke and stream retry paths. ZERO when the base is 0.
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 RetryPolicy
impl<'de> Deserialize<'de> for RetryPolicy
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
Source§impl Serialize for RetryPolicy
impl Serialize 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