Skip to main content

RetryProvider

Trait RetryProvider 

Source
pub trait RetryProvider<Ctx>: Send + Sync {
    // Provided methods
    fn max_attempts(_ctx: &Ctx, _tool_name: &str, _args: &Value) -> u32 { ... }
    fn should_retry(
        _ctx: &Ctx,
        _tool_name: &str,
        _attempt: u32,
        _error: &Error,
    ) -> bool { ... }
    fn backoff_duration(_ctx: &Ctx, _tool_name: &str, _attempt: u32) -> Duration { ... }
}
Expand description

Provider trait for retry behavior around tool execution.

Provided Methods§

Source

fn max_attempts(_ctx: &Ctx, _tool_name: &str, _args: &Value) -> u32

Source

fn should_retry( _ctx: &Ctx, _tool_name: &str, _attempt: u32, _error: &Error, ) -> bool

Source

fn backoff_duration(_ctx: &Ctx, _tool_name: &str, _attempt: u32) -> Duration

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§