pub struct ToolRegistry { /* private fields */ }Expand description
Registry of named tools with their async handlers.
Implements Dispatcher directly — tools() returns schemas and
dispatch() looks up handlers by name. Used as both the runtime’s
shared store and the per-agent dispatcher snapshot.
Implementations§
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn remove(&mut self, name: &str) -> bool
pub fn remove(&mut self, name: &str) -> bool
Remove a tool by name. Returns true if it existed.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&Tool, &Handler)>
pub fn iter(&self) -> impl Iterator<Item = (&Tool, &Handler)>
Iterate over all (Tool, Handler) pairs.
Sourcepub fn filtered_snapshot(&self, names: &[CompactString]) -> Self
pub fn filtered_snapshot(&self, names: &[CompactString]) -> Self
Build a filtered snapshot containing only the named tools.
If names is empty, all tools are included. Used by runtime to
build a per-agent dispatcher.
Trait Implementations§
Source§impl Clone for ToolRegistry
impl Clone for ToolRegistry
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
Source§impl Dispatcher for ToolRegistry
impl Dispatcher for ToolRegistry
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