pub struct ClientToolRegistry { /* private fields */ }Expand description
The client-performed tool declarations a server was started with.
The counterpart of ToolRegistry, and deliberately a
separate type: that one holds executable tools this server dispatches, this
one holds declarations of tools it never runs. Merging them would put a
DynTool with no implementation into the registry a graph tool node
resolves through, and a graph node would then resolve a tool that cannot be
called.
Empty is the default and is a complete, honest state: every client-tool
intent is a clean unknown_tool until an operator declares one. There is no
“no registry wired” case to distinguish, unlike the executable registry,
because nothing is ever dispatched here.
Implementations§
Source§impl ClientToolRegistry
impl ClientToolRegistry
Sourcepub fn declare(&mut self, decl: ClientToolDecl)
pub fn declare(&mut self, decl: ClientToolDecl)
Records decl under its own ClientToolDecl::name, replacing any
declaration already held under that name, so a host composing a set
keeps the last word (the same rule ToolRegistry
uses).
Sourcepub fn with_decl(self, decl: ClientToolDecl) -> Self
pub fn with_decl(self, decl: ClientToolDecl) -> Self
Records decl and returns the registry, for the builder style a host
composes with.
Sourcepub fn get(&self, name: &str) -> Option<&ClientToolDecl>
pub fn get(&self, name: &str) -> Option<&ClientToolDecl>
The declaration held under name, if any. None is the unknown_tool
case the client-tool intent endpoint reports without writing anything.
Trait Implementations§
Source§impl Clone for ClientToolRegistry
impl Clone for ClientToolRegistry
Source§fn clone(&self) -> ClientToolRegistry
fn clone(&self) -> ClientToolRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more