pub struct ToolErrorPolicyLayer { /* private fields */ }Expand description
tower::Layer applying ToolErrorPolicy to every
Service<ToolInvocation> dispatch. Cloning is a single-byte
copy of the inner ToolErrorPolicy (no heap allocation).
Implementations§
Source§impl ToolErrorPolicyLayer
impl ToolErrorPolicyLayer
Sourcepub const NAME: &'static str = "tool_error_policy"
pub const NAME: &'static str = "tool_error_policy"
Patch-version-stable identifier surfaced through
crate::ToolRegistry::layer_names. Renaming this constant
is a breaking change for dashboards keyed off the value.
Sourcepub const fn new(policy: ToolErrorPolicy) -> Self
pub const fn new(policy: ToolErrorPolicy) -> Self
Build the layer with the supplied policy.
Sourcepub const fn policy(&self) -> &ToolErrorPolicy
pub const fn policy(&self) -> &ToolErrorPolicy
Borrow the wrapped policy — useful for diagnostic dumps and
layer_names correlation.
Trait Implementations§
Source§impl Clone for ToolErrorPolicyLayer
impl Clone for ToolErrorPolicyLayer
Source§fn clone(&self) -> ToolErrorPolicyLayer
fn clone(&self) -> ToolErrorPolicyLayer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ToolErrorPolicyLayer
impl Debug for ToolErrorPolicyLayer
Source§impl<S> Layer<S> for ToolErrorPolicyLayer
impl<S> Layer<S> for ToolErrorPolicyLayer
Source§impl NamedLayer for ToolErrorPolicyLayer
impl NamedLayer for ToolErrorPolicyLayer
Source§fn layer_name(&self) -> &'static str
fn layer_name(&self) -> &'static str
Stable, patch-version-stable identifier surfaced through
crate::ChatModel::layer_names. See trait doc for the
naming convention.impl Copy for ToolErrorPolicyLayer
Auto Trait Implementations§
impl Freeze for ToolErrorPolicyLayer
impl RefUnwindSafe for ToolErrorPolicyLayer
impl Send for ToolErrorPolicyLayer
impl Sync for ToolErrorPolicyLayer
impl Unpin for ToolErrorPolicyLayer
impl UnsafeUnpin for ToolErrorPolicyLayer
impl UnwindSafe for ToolErrorPolicyLayer
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