pub struct AgentSwarm { /* private fields */ }Expand description
Main coordinator for managing a swarm of autonomous agents
Implementations§
Source§impl AgentSwarm
impl AgentSwarm
Sourcepub fn new(config: SwarmConfig) -> Self
pub fn new(config: SwarmConfig) -> Self
Create a new agent swarm with the specified configuration
Sourcepub async fn spawn_agent(
&self,
id: impl Into<String>,
capabilities: Vec<String>,
) -> Option<Agent>
pub async fn spawn_agent( &self, id: impl Into<String>, capabilities: Vec<String>, ) -> Option<Agent>
Spawn a new agent with the specified capabilities
Sourcepub async fn broadcast_message(
&self,
from_agent: &str,
msg_type: &str,
payload: Value,
) -> usize
pub async fn broadcast_message( &self, from_agent: &str, msg_type: &str, payload: Value, ) -> usize
Broadcast a message to all agents except the sender
Sourcepub async fn get_stats(&self) -> SwarmStats
pub async fn get_stats(&self) -> SwarmStats
Get current swarm statistics
Auto Trait Implementations§
impl Freeze for AgentSwarm
impl !RefUnwindSafe for AgentSwarm
impl Send for AgentSwarm
impl Sync for AgentSwarm
impl Unpin for AgentSwarm
impl !UnwindSafe for AgentSwarm
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