pub struct ModelRetry { /* private fields */ }Expand description
Retry the underlying LLM call when it fails with a retryable
CognisError (rate-limited, network, timeout, transient provider error).
Implementations§
Source§impl ModelRetry
impl ModelRetry
Sourcepub fn new(max_attempts: u32) -> Self
pub fn new(max_attempts: u32) -> Self
Build with default backoff: 100ms initial, 2x multiplier, 30s cap.
Sourcepub fn with_initial_delay(self, d: Duration) -> Self
pub fn with_initial_delay(self, d: Duration) -> Self
Override the initial delay.
Sourcepub fn with_multiplier(self, m: f64) -> Self
pub fn with_multiplier(self, m: f64) -> Self
Override the backoff multiplier.
Sourcepub fn with_max_delay(self, d: Duration) -> Self
pub fn with_max_delay(self, d: Duration) -> Self
Override the cap on per-attempt delay.
Trait Implementations§
Source§impl Middleware for ModelRetry
impl Middleware for ModelRetry
Auto Trait Implementations§
impl Freeze for ModelRetry
impl RefUnwindSafe for ModelRetry
impl Send for ModelRetry
impl Sync for ModelRetry
impl Unpin for ModelRetry
impl UnsafeUnpin for ModelRetry
impl UnwindSafe for ModelRetry
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