pub struct ToolRegistry { /* private fields */ }Expand description
Tool registry
Implementations§
Source§impl ToolRegistry
impl ToolRegistry
pub fn new() -> Self
pub fn register<T: Tool + 'static>(&mut self, tool: T)
pub async fn execute( &self, tool_call: &ToolCall, ) -> Result<ToolResult, ToolError>
pub fn get_tool_names(&self) -> Vec<String>
pub fn get_tool(&self, name: &str) -> Option<&dyn Tool>
pub fn get_all_tools(&self) -> Vec<&dyn Tool>
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