pub struct AgentRegistry { /* private fields */ }Expand description
In-memory agent directory keyed by agent URL (P2-8).
Register every agent’s AgentCard, then discover by skill
(AgentRegistry::search_skill) or data boundary
(AgentRegistry::filter_data_class) instead of hardcoding URLs. All
operations are cheap hash lookups behind a short-lived mutex.
Implementations§
Source§impl AgentRegistry
impl AgentRegistry
Sourcepub fn register(&self, card: AgentCard) -> Result<(), RegistryError>
pub fn register(&self, card: AgentCard) -> Result<(), RegistryError>
Register an agent. Fails if the URL is already registered — use
AgentRegistry::upsert to replace a card in place.
Sourcepub fn unregister(&self, url: &str) -> bool
pub fn unregister(&self, url: &str) -> bool
Remove an agent by URL. Returns true if it was present.
Sourcepub fn search_skill(&self, query: &str) -> Vec<AgentCard>
pub fn search_skill(&self, query: &str) -> Vec<AgentCard>
Discover agents advertising a skill whose id/name/description contains
query (case-insensitive substring match).
Sourcepub fn filter_data_class(&self, class: &str) -> Vec<AgentCard>
pub fn filter_data_class(&self, class: &str) -> Vec<AgentCard>
Discover agents whose card declares exactly class as its data class
(data boundary, P2-8).
Trait Implementations§
Source§impl Debug for AgentRegistry
impl Debug for AgentRegistry
Source§impl Default for AgentRegistry
impl Default for AgentRegistry
Source§fn default() -> AgentRegistry
fn default() -> AgentRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for AgentRegistry
impl RefUnwindSafe for AgentRegistry
impl Send for AgentRegistry
impl Sync for AgentRegistry
impl Unpin for AgentRegistry
impl UnsafeUnpin for AgentRegistry
impl UnwindSafe for AgentRegistry
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