pub struct ToolRegistry { /* private fields */ }Expand description
Registry of available tools, keyed by name.
Implementations§
Source§impl ToolRegistry
impl ToolRegistry
pub fn new() -> Self
pub fn with(self, tool: Arc<dyn AgentTool>) -> Self
pub fn register(&mut self, tool: Arc<dyn AgentTool>)
pub fn get(&self, name: &str) -> Option<Arc<dyn AgentTool>>
pub fn history_policy(&self, name: &str) -> ToolHistoryPolicy
Sourcepub fn identity_policy(&self, name: &str) -> ToolIdentityPolicy
pub fn identity_policy(&self, name: &str) -> ToolIdentityPolicy
Identity declaration for one tool — used by the semantic-loop detector and other plugins that need to recognize repeats. Returns the default (“single opaque operation”) for unknown names; the detector treats that as the historical fall-through and falls back to canonical-JSON identity.
Sourcepub fn identity_policies(&self) -> HashMap<String, ToolIdentityPolicy>
pub fn identity_policies(&self) -> HashMap<String, ToolIdentityPolicy>
Snapshot of identity policies for every registered tool. The
SemanticLoopDetector (and any future plugin that needs the
same identity contract) takes one of these at construction so
it does not have to hold an Arc<ToolRegistry>.
pub fn names(&self) -> Vec<&str>
pub fn iter(&self) -> impl Iterator<Item = &Arc<dyn AgentTool>>
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
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 Debug for ToolRegistry
impl Debug 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
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