pub struct RetryToolLayer { /* private fields */ }Expand description
tower::Layer that retries tool dispatches per the wrapped tool’s
RetryHint metadata.
Cloning is cheap — internal state is Arc-backed.
Implementations§
Source§impl RetryToolLayer
impl RetryToolLayer
Sourcepub const NAME: &'static str = "tool_retry"
pub const NAME: &'static str = "tool_retry"
Patch-version-stable identifier surfaced through
ToolRegistry::layer_names. Distinguished from the
transport-level crate::transports::RetryLayer ("retry")
— this layer drives per-tool retries from the wrapped tool’s
RetryHint metadata, not from a
global crate::transports::RetryPolicy. Renaming this
constant is a breaking change for dashboards keyed off the
value.
Sourcepub fn new() -> Self
pub fn new() -> Self
Build with the default classifier (DefaultRetryClassifier)
and DEFAULT_MAX_BACKOFF cap.
Sourcepub fn with_classifier(self, classifier: Arc<dyn RetryClassifier>) -> Self
pub fn with_classifier(self, classifier: Arc<dyn RetryClassifier>) -> Self
Replace the RetryClassifier consulted on each failure.
Operators with custom retry policy (e.g. retry only on
Transient, ignore RateLimit) install their own
classifier here.
Sourcepub const fn with_max_backoff(self, max: Duration) -> Self
pub const fn with_max_backoff(self, max: Duration) -> Self
Override the per-attempt backoff cap. The geometric growth of
hint.initial_backoff * 2^attempt is clamped to this value
before jitter is applied.
Trait Implementations§
Source§impl Clone for RetryToolLayer
impl Clone for RetryToolLayer
Source§fn clone(&self) -> RetryToolLayer
fn clone(&self) -> RetryToolLayer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RetryToolLayer
impl Debug for RetryToolLayer
Source§impl Default for RetryToolLayer
impl Default for RetryToolLayer
Source§impl<S> Layer<S> for RetryToolLayer
impl<S> Layer<S> for RetryToolLayer
Source§impl NamedLayer for RetryToolLayer
impl NamedLayer for RetryToolLayer
Source§fn layer_name(&self) -> &'static str
fn layer_name(&self) -> &'static str
crate::ChatModel::layer_names. See trait doc for the
naming convention.