pub struct ToolRegistry { /* private fields */ }Expand description
Tool registry
A tool registry using HashMap for O(1) lookup.
§Fields
tools: Dictionary storing tools, keyed by tool name
Implementations§
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new tool registry
§Examples
use crates_docs::tools::ToolRegistry;
let registry = ToolRegistry::new();
assert!(registry.is_empty());Sourcepub async fn execute_tool(
&self,
name: &str,
arguments: Value,
) -> Result<CallToolResult, CallToolError>
pub async fn execute_tool( &self, name: &str, arguments: Value, ) -> Result<CallToolResult, CallToolError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolRegistry
impl !RefUnwindSafe for ToolRegistry
impl Send for ToolRegistry
impl Sync for ToolRegistry
impl Unpin for ToolRegistry
impl UnsafeUnpin 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