pub struct CatalogReader { /* private fields */ }Expand description
Read side of a dynamic tool catalog. Implements ToolSource and is the
value handed to [agentkit_loop::AgentBuilder::tools]. Cloning subscribes
a fresh broadcast receiver, so independent observers don’t compete for
catalog events.
Implementations§
Source§impl CatalogReader
impl CatalogReader
Sourcepub fn subscribe(&self) -> Receiver<ToolCatalogEvent>
pub fn subscribe(&self) -> Receiver<ToolCatalogEvent>
Subscribes a fresh broadcast receiver — equivalent to
CatalogWriter::subscribe.
Trait Implementations§
Source§impl Clone for CatalogReader
impl Clone for CatalogReader
Source§impl ToolSource for CatalogReader
impl ToolSource for CatalogReader
Source§fn get(&self, name: &ToolName) -> Option<Arc<dyn Tool>>
fn get(&self, name: &ToolName) -> Option<Arc<dyn Tool>>
Looks up a tool by name, returning
None if not present.Source§fn drain_catalog_events(&self) -> Vec<ToolCatalogEvent>
fn drain_catalog_events(&self) -> Vec<ToolCatalogEvent>
Drains pending catalog change events. Static sources return an empty
list; dynamic sources surface added/removed/changed batches that the
loop forwards to the model on the next turn.
Source§fn prefixed(self, prefix: impl Into<String>) -> Prefixed<Self>where
Self: Sized,
fn prefixed(self, prefix: impl Into<String>) -> Prefixed<Self>where
Self: Sized,
Wraps this source so every advertised tool name is prefixed with
<prefix>_. Useful for mounting the same source under multiple
namespaces, or for avoiding collisions between MCP catalogs. Read moreSource§fn filtered<F>(self, predicate: F) -> Filtered<Self, F>
fn filtered<F>(self, predicate: F) -> Filtered<Self, F>
Wraps this source so only tools whose name passes
predicate are
advertised and resolvable. Tools rejected by the predicate are
invisible to the model and return None on lookup. Read moreAuto Trait Implementations§
impl !Freeze for CatalogReader
impl RefUnwindSafe for CatalogReader
impl Send for CatalogReader
impl Sync for CatalogReader
impl Unpin for CatalogReader
impl UnsafeUnpin for CatalogReader
impl UnwindSafe for CatalogReader
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