pub struct SimpleToolAdapter<T> { /* private fields */ }Expand description
Adapter that turns any SimpleTool into a full Tool with
Name = DynamicToolName.
You rarely name this type directly — register a SimpleTool with
ToolRegistry::register_simple, which wraps it for you. Use this adapter
explicitly only when you need a Tool value (e.g. to pass to code that is
generic over Tool).
Implementations§
Source§impl<T> SimpleToolAdapter<T>
impl<T> SimpleToolAdapter<T>
Sourcepub const fn new(tool: T) -> SimpleToolAdapter<T>
pub const fn new(tool: T) -> SimpleToolAdapter<T>
Wrap a SimpleTool so it can be used anywhere a Tool is expected.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Unwrap the inner SimpleTool.
Trait Implementations§
Source§impl<Ctx, T> Tool<Ctx> for SimpleToolAdapter<T>where
T: SimpleTool<Ctx>,
impl<Ctx, T> Tool<Ctx> for SimpleToolAdapter<T>where
T: SimpleTool<Ctx>,
Source§type Name = DynamicToolName
type Name = DynamicToolName
The type of name for this tool.
Source§fn name(&self) -> DynamicToolName
fn name(&self) -> DynamicToolName
Returns the tool’s strongly-typed name.
Source§fn display_name(&self) -> &'static str
fn display_name(&self) -> &'static str
Human-readable display name for UI (e.g., “Read File” vs “read”). Read more
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
Human-readable description of what the tool does.
Source§fn input_schema(&self) -> Value
fn input_schema(&self) -> Value
JSON schema for the tool’s input parameters.
Auto Trait Implementations§
impl<T> Freeze for SimpleToolAdapter<T>where
T: Freeze,
impl<T> RefUnwindSafe for SimpleToolAdapter<T>where
T: RefUnwindSafe,
impl<T> Send for SimpleToolAdapter<T>where
T: Send,
impl<T> Sync for SimpleToolAdapter<T>where
T: Sync,
impl<T> Unpin for SimpleToolAdapter<T>where
T: Unpin,
impl<T> UnsafeUnpin for SimpleToolAdapter<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for SimpleToolAdapter<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