pub struct AgentRegistry { /* private fields */ }Expand description
Registry of agents available for delegation
Implementations§
Source§impl AgentRegistry
impl AgentRegistry
Sourcepub fn new(message_sender: MessageSender) -> Self
pub fn new(message_sender: MessageSender) -> Self
Create a new agent registry with a message sender callback
Sourcepub fn register_agent(&self, info: AgentInfo)
pub fn register_agent(&self, info: AgentInfo)
Register an agent for delegation
Sourcepub fn register(
&self,
id: AgentId,
name: impl Into<String>,
description: impl Into<String>,
)
pub fn register( &self, id: AgentId, name: impl Into<String>, description: impl Into<String>, )
Register an agent with basic info
Sourcepub fn unregister(&self, id: &AgentId)
pub fn unregister(&self, id: &AgentId)
Unregister an agent
Sourcepub fn list_agents(&self) -> Vec<AgentInfo>
pub fn list_agents(&self) -> Vec<AgentInfo>
List all available agents
Sourcepub fn find_by_tag(&self, tag: &str) -> Vec<AgentInfo>
pub fn find_by_tag(&self, tag: &str) -> Vec<AgentInfo>
Find agents by tag
Sourcepub fn set_available(&self, id: &AgentId, available: bool)
pub fn set_available(&self, id: &AgentId, available: bool)
Set agent availability
Sourcepub fn register_response_channel(&self, agent_id: AgentId) -> Receiver<Message>
pub fn register_response_channel(&self, agent_id: AgentId) -> Receiver<Message>
Register a response channel for an agent
Sourcepub fn deliver_response(&self, from_agent: &AgentId, message: Message)
pub fn deliver_response(&self, from_agent: &AgentId, message: Message)
Deliver a response to waiting channels
Sourcepub fn agent_count(&self) -> usize
pub fn agent_count(&self) -> usize
Get count of registered agents
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