pub struct ToolRegistry { /* private fields */ }Expand description
Registry mapping tool names to implementations.
Implementations§
Source§impl ToolRegistry
impl ToolRegistry
pub fn new() -> Self
pub fn register<T>(&mut self, tool: T)where
T: Tool + 'static,
pub fn register_boxed(&mut self, tool: Box<dyn Tool>)
pub fn get(&self, name: &str) -> Option<Arc<dyn Tool>>
pub async fn invoke( &self, name: &str, args: Value, ) -> Result<ToolResult, ToolError>
Trait Implementations§
Source§impl Default for ToolRegistry
impl Default for ToolRegistry
Source§fn default() -> ToolRegistry
fn default() -> ToolRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ToolRegistry
impl !RefUnwindSafe for ToolRegistry
impl Send for ToolRegistry
impl Sync for ToolRegistry
impl Unpin for ToolRegistry
impl !UnwindSafe for ToolRegistry
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