pub struct ToolRegistry { /* private fields */ }Implementations§
Source§impl ToolRegistry
impl ToolRegistry
pub fn new(transport: Arc<dyn ToolTransport>) -> Self
Sourcepub fn transport(&self) -> &Arc<dyn ToolTransport> ⓘ
pub fn transport(&self) -> &Arc<dyn ToolTransport> ⓘ
Returns a reference to the transport layer.
Sourcepub fn with_same_transport(&self) -> Self
pub fn with_same_transport(&self) -> Self
Create a new empty registry that shares the same transport.
pub fn register(self, tool: Arc<dyn Tool>) -> Self
Sourcepub fn register_mut(&mut self, tool: Arc<dyn Tool>)
pub fn register_mut(&mut self, tool: Arc<dyn Tool>)
Register a tool via mutable reference (for use with shared registries).
pub fn specs(&self) -> Vec<ToolSpec>
pub fn names(&self) -> Vec<String>
pub fn get(&self, name: &str) -> Option<Arc<dyn Tool>>
Sourcepub fn is_readonly(&self, name: &str) -> bool
pub fn is_readonly(&self, name: &str) -> bool
Check if a tool is read-only (no side effects).
pub async fn invoke(&self, name: &str, arguments: Value) -> Result<String>
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 moreAuto 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