pub struct SchemaToolAdapter<T: SchemaTool> { /* private fields */ }Expand description
Adapter that exposes any SchemaTool through the erased
Tool trait.
The adapter owns the inner typed tool plus a pre-built
ToolMetadata (input schema generated from the Input type,
effect / version / retry hint pulled from the SchemaTool
overrides) so the runtime hot path is a single pointer
dereference.
Implementations§
Source§impl<T: SchemaTool> SchemaToolAdapter<T>
impl<T: SchemaTool> SchemaToolAdapter<T>
Trait Implementations§
Source§impl<T: SchemaTool> Debug for SchemaToolAdapter<T>
impl<T: SchemaTool> Debug for SchemaToolAdapter<T>
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Surfaces the metadata identity without forcing T: Debug —
the wrapped tool’s internals are opaque to the adapter, so
transitively requiring a Debug bound on every typed tool is
noise. The metadata name is the operationally meaningful
identifier in logs / crash dumps.
Source§impl<T: SchemaTool> Tool for SchemaToolAdapter<T>
impl<T: SchemaTool> Tool for SchemaToolAdapter<T>
Source§fn metadata(&self) -> &ToolMetadata
fn metadata(&self) -> &ToolMetadata
Borrow this tool’s descriptor. Cheap — implementors return a
reference to a field they constructed once.
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
input: Value,
ctx: &'life1 AgentContext<()>,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
input: Value,
ctx: &'life1 AgentContext<()>,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run the tool against
input. ctx carries the infra
context (cancellation, deadline, tenant scope — reachable
via ctx.core() or the forwarder accessors) and the typed
operator-side deps D (reachable via ctx.deps()).
Credentials never appear in either slot (invariant 10).Auto Trait Implementations§
impl<T> Freeze for SchemaToolAdapter<T>where
T: Freeze,
impl<T> RefUnwindSafe for SchemaToolAdapter<T>where
T: RefUnwindSafe,
impl<T> Send for SchemaToolAdapter<T>
impl<T> Sync for SchemaToolAdapter<T>
impl<T> Unpin for SchemaToolAdapter<T>where
T: Unpin,
impl<T> UnsafeUnpin for SchemaToolAdapter<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for SchemaToolAdapter<T>where
T: UnwindSafe,
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> 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