pub struct ToolRegistry { /* private fields */ }Implementations§
Source§impl ToolRegistry
impl ToolRegistry
pub fn register(&mut self, tool: impl Tool + 'static)
pub fn register_arc(&mut self, tool: Arc<dyn Tool>)
pub fn update(&mut self, tool: impl Tool + 'static)
pub fn get(&self, name: &str) -> Option<Arc<dyn Tool>>
pub fn definitions(&self) -> Vec<Value>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn metadatas(&self) -> Vec<ToolMetadata>
pub fn metadatas(&self) -> Vec<ToolMetadata>
Collect metadata for every registered tool, sorted by name.
This is the preferred introspection API for consumers — it returns a
stable ToolMetadata struct per tool instead of having callers parse
the LLM-facing JSON definitions.
Sourcepub fn inject_event_bus(&self, event_bus: &EventBus)
pub fn inject_event_bus(&self, event_bus: &EventBus)
Inject the internal EventBus into framework-provided tools.
Trait Implementations§
Source§impl Clone for ToolRegistry
impl Clone for ToolRegistry
Source§fn clone(&self) -> ToolRegistry
fn clone(&self) -> ToolRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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 !RefUnwindSafe for ToolRegistry
impl !UnwindSafe for ToolRegistry
impl Freeze for ToolRegistry
impl Send for ToolRegistry
impl Sync for ToolRegistry
impl Unpin for ToolRegistry
impl UnsafeUnpin 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