pub struct Registry { /* private fields */ }Expand description
A set of tools keyed by their model-facing wire names, plus the one dispatch
door every call funnels through (ADR-0008).
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn specs(&self) -> Vec<ToolSpec>
pub fn specs(&self) -> Vec<ToolSpec>
The neutral tool specs for every registered tool, unordered.
Sourcepub async fn dispatch(
&self,
name: &str,
raw_args: Value,
ctx: &ToolCtx,
) -> Dispatched
pub async fn dispatch( &self, name: &str, raw_args: Value, ctx: &ToolCtx, ) -> Dispatched
The single door every tool call funnels through (ADR-0008).
Resolves name, decodes raw_args, runs the tool, and returns both the
history tool_result and the report ToolCallRecord. An unknown tool and
bad args are soft (ToolError::Respond shape); a ToolError::Fatal
still yields a paired result but sets Dispatched::fatal. ctx.call_id
supplies the pairing id.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Registry
impl !UnwindSafe for Registry
impl Freeze for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
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