pub struct RetryFallback { /* private fields */ }Expand description
Retry fallback handler with exponential backoff.
Retries tool execution on transient errors using exponential backoff. Useful for network timeouts or temporary resource issues.
§Example
use forge_agent::workflow::tools::RetryFallback;
// Retry up to 3 times with 100ms base backoff
let fallback = RetryFallback::new(3, 100);Implementations§
Source§impl RetryFallback
impl RetryFallback
Sourcepub fn new(max_attempts: u32, backoff_ms: u64) -> Self
pub fn new(max_attempts: u32, backoff_ms: u64) -> Self
Creates a new RetryFallback.
§Arguments
max_attempts- Maximum number of retry attempts (including initial attempt)backoff_ms- Base backoff duration in milliseconds (exponential: backoff_ms * 2^attempt)
§Example
use forge_agent::workflow::tools::RetryFallback;
let fallback = RetryFallback::new(3, 100);Trait Implementations§
Source§impl Clone for RetryFallback
impl Clone for RetryFallback
Source§fn clone(&self) -> RetryFallback
fn clone(&self) -> RetryFallback
Returns a duplicate of the value. Read more
1.0.0 · 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 RetryFallback
impl Debug for RetryFallback
Source§impl FallbackHandler for RetryFallback
impl FallbackHandler for RetryFallback
Source§fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
error: &'life1 ToolError,
invocation: &'life2 ToolInvocation,
) -> Pin<Box<dyn Future<Output = FallbackResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
error: &'life1 ToolError,
invocation: &'life2 ToolInvocation,
) -> Pin<Box<dyn Future<Output = FallbackResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Handles a tool execution error. Read more
Auto Trait Implementations§
impl Freeze for RetryFallback
impl RefUnwindSafe for RetryFallback
impl Send for RetryFallback
impl Sync for RetryFallback
impl Unpin for RetryFallback
impl UnsafeUnpin for RetryFallback
impl UnwindSafe for RetryFallback
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more