pub trait Actor: Send + Sync {
// Required methods
fn actor_id(&self) -> &str;
fn actor_status(&self) -> ActorStatus;
fn initialize<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn shutdown<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Actor trait for swarm participants
An Actor is an entity that can participate in the swarm by receiving and processing messages. This is the base trait for all swarm participants.
Required Methods§
Sourcefn actor_status(&self) -> ActorStatus
fn actor_status(&self) -> ActorStatus
Get the actor’s current status