pub struct RetryState {
pub consecutive_failures: u32,
pub rate_limit_retries: u32,
pub overload_retries: u32,
pub using_fallback: bool,
}Expand description
State tracker for retry logic across multiple attempts.
Fields§
§consecutive_failures: u32Number of consecutive failures.
rate_limit_retries: u32Number of 429 (rate limit) retries.
overload_retries: u32Number of 529 (overload) retries.
using_fallback: boolWhether we’ve fallen back to the smaller model.
Implementations§
Source§impl RetryState
impl RetryState
Sourcepub fn next_action(
&mut self,
error: &RetryableError,
config: &RetryConfig,
) -> RetryAction
pub fn next_action( &mut self, error: &RetryableError, config: &RetryConfig, ) -> RetryAction
Determine the next action after a failure.
Trait Implementations§
Source§impl Debug for RetryState
impl Debug for RetryState
Source§impl Default for RetryState
impl Default for RetryState
Source§fn default() -> RetryState
fn default() -> RetryState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RetryState
impl RefUnwindSafe for RetryState
impl Send for RetryState
impl Sync for RetryState
impl Unpin for RetryState
impl UnsafeUnpin for RetryState
impl UnwindSafe for RetryState
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