pub struct ToolRegistry { /* private fields */ }Implementations§
Source§impl ToolRegistry
impl ToolRegistry
pub fn new() -> Self
pub fn insert(&mut self, t: Arc<dyn Tool>)
Sourcepub fn schemas(&self) -> Vec<ToolSchema>
pub fn schemas(&self) -> Vec<ToolSchema>
Tool schemas in a stable, name-sorted order. Deterministic ordering
keeps the request’s tools block byte-identical across turns, which is
what lets a provider’s prefix cache (e.g. DeepSeek) hit — a HashMap’s
arbitrary iteration order would silently break it.
pub async fn dispatch( &self, action: &Action, world: &mut World, ) -> Result<ToolResult, ToolError>
Sourcepub fn risk(&self, name: &str) -> Option<ToolRisk>
pub fn risk(&self, name: &str) -> Option<ToolRisk>
The risk class of a tool by name (used to decide parallel-safe dispatch).
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
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 !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