pub struct InMemoryToolRegistry { /* private fields */ }Implementations§
Source§impl InMemoryToolRegistry
impl InMemoryToolRegistry
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, id: &str) -> Option<Arc<dyn Tool>>
pub fn ids(&self) -> impl Iterator<Item = &String>
pub fn register(&mut self, tool: Arc<dyn Tool>) -> Result<(), ToolRegistryError>
pub fn register_named( &mut self, id: impl Into<String>, tool: Arc<dyn Tool>, ) -> Result<(), ToolRegistryError>
pub fn extend_named( &mut self, tools: HashMap<String, Arc<dyn Tool>>, ) -> Result<(), ToolRegistryError>
pub fn extend_registry( &mut self, other: &dyn ToolRegistry, ) -> Result<(), ToolRegistryError>
pub fn merge_many( regs: impl IntoIterator<Item = InMemoryToolRegistry>, ) -> Result<InMemoryToolRegistry, ToolRegistryError>
pub fn into_map(self) -> HashMap<String, Arc<dyn Tool>>
pub fn to_map(&self) -> HashMap<String, Arc<dyn Tool>>
Trait Implementations§
Source§impl Clone for InMemoryToolRegistry
impl Clone for InMemoryToolRegistry
Source§fn clone(&self) -> InMemoryToolRegistry
fn clone(&self) -> InMemoryToolRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InMemoryToolRegistry
impl Debug for InMemoryToolRegistry
Source§impl Default for InMemoryToolRegistry
impl Default for InMemoryToolRegistry
Source§fn default() -> InMemoryToolRegistry
fn default() -> InMemoryToolRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InMemoryToolRegistry
impl !RefUnwindSafe for InMemoryToolRegistry
impl Send for InMemoryToolRegistry
impl Sync for InMemoryToolRegistry
impl Unpin for InMemoryToolRegistry
impl !UnwindSafe for InMemoryToolRegistry
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