pub struct ToolRegistry { /* private fields */ }Expand description
Registry for named capability-protected tools.
Implementations§
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn register<P, R, F>(&mut self, tool: ProtectedTool<P, R, F>)where
P: Permission + 'static,
R: Resource + 'static,
F: for<'a> Fn(&'a R) -> ToolFuture<'a> + Send + Sync + 'static,
pub fn register<P, R, F>(&mut self, tool: ProtectedTool<P, R, F>)where
P: Permission + 'static,
R: Resource + 'static,
F: for<'a> Fn(&'a R) -> ToolFuture<'a> + Send + Sync + 'static,
Register a protected tool by its exposed name.
Registering another tool with the same name replaces the previous one.
Sourcepub fn list_specs(&self) -> Vec<ToolSpec>
pub fn list_specs(&self) -> Vec<ToolSpec>
Return metadata for every registered tool.
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