pub struct MultiAgentService { /* private fields */ }Expand description
Multi-agent coordination service
Implementations§
Source§impl MultiAgentService
impl MultiAgentService
Sourcepub fn new(coordinator: Arc<MultiAgentCoordinator>, agent_id: Uuid) -> Self
pub fn new(coordinator: Arc<MultiAgentCoordinator>, agent_id: Uuid) -> Self
Create a new multi-agent service
Sourcepub async fn request_help(
&self,
capability: &str,
data: Value,
) -> Result<Option<Uuid>>
pub async fn request_help( &self, capability: &str, data: Value, ) -> Result<Option<Uuid>>
Request help from another agent
Sourcepub fn offer_capability(
&self,
name: String,
description: String,
proficiency: f32,
) -> Result<()>
pub fn offer_capability( &self, name: String, description: String, proficiency: f32, ) -> Result<()>
Offer help for a capability
Sourcepub fn get_messages(&self) -> Vec<CoordinationMessage>
pub fn get_messages(&self) -> Vec<CoordinationMessage>
Get pending messages
Sourcepub fn update_status(&self, status: AgentStatus, load: f32) -> Result<()>
pub fn update_status(&self, status: AgentStatus, load: f32) -> Result<()>
Update status
Trait Implementations§
Source§impl Service for MultiAgentService
impl Service for MultiAgentService
Source§fn service_type(&self) -> &str
fn service_type(&self) -> &str
Service type name (unique identifier)
Source§fn initialize<'life0, 'async_trait>(
&'life0 mut self,
_runtime: Arc<dyn Any + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn initialize<'life0, 'async_trait>(
&'life0 mut self,
_runtime: Arc<dyn Any + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Initialize the service
Source§fn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the service (begin background tasks)
Source§fn query_agents(&self, capability: &str) -> Option<Vec<(Uuid, f32)>>
fn query_agents(&self, capability: &str) -> Option<Vec<(Uuid, f32)>>
Optional agent query hook for coordination services
Source§fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop the service (cleanup)
Source§fn is_running(&self) -> bool
fn is_running(&self) -> bool
Check if service is running
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ServiceHealth>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ServiceHealth>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get service health status
Auto Trait Implementations§
impl Freeze for MultiAgentService
impl RefUnwindSafe for MultiAgentService
impl Send for MultiAgentService
impl Sync for MultiAgentService
impl Unpin for MultiAgentService
impl UnwindSafe for MultiAgentService
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more