pub trait ToolRegistry:
Send
+ Sync
+ 'static {
// Required methods
fn list(&self) -> Vec<Arc<dyn Tool>>;
fn get(&self, n: &str) -> Option<Arc<dyn Tool>>;
fn register(&self, t: Arc<dyn Tool>) -> Disposer;
fn replace(&self, t: Arc<dyn Tool>) -> Disposer;
fn remove(&self, name: &str) -> usize;
// Provided methods
fn names(&self) -> Vec<String> { ... }
fn len(&self) -> usize { ... }
fn is_empty(&self) -> bool { ... }
}Required Methods§
fn list(&self) -> Vec<Arc<dyn Tool>>
fn get(&self, n: &str) -> Option<Arc<dyn Tool>>
Sourcefn register(&self, t: Arc<dyn Tool>) -> Disposer
fn register(&self, t: Arc<dyn Tool>) -> Disposer
Add a tool, returning a handle that can withdraw exactly this registration.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".