pub struct EchoActor;Expand description
Example echo actor behavior
Trait Implementations§
Source§impl ActorBehavior for EchoActor
impl ActorBehavior for EchoActor
Source§fn receive(
&mut self,
message: Message,
_ctx: &mut ActorContext,
) -> Result<Option<Message>>
fn receive( &mut self, message: Message, _ctx: &mut ActorContext, ) -> Result<Option<Message>>
Handle incoming messages Read more
Source§fn pre_start(&mut self, _ctx: &mut ActorContext) -> Result<()>
fn pre_start(&mut self, _ctx: &mut ActorContext) -> Result<()>
Called when the actor starts Read more
Source§fn post_stop(&mut self, _ctx: &mut ActorContext) -> Result<()>
fn post_stop(&mut self, _ctx: &mut ActorContext) -> Result<()>
Called when the actor stops Read more
Source§fn pre_restart(&mut self, _ctx: &mut ActorContext, _reason: &str) -> Result<()>
fn pre_restart(&mut self, _ctx: &mut ActorContext, _reason: &str) -> Result<()>
Called when the actor is about to restart Read more
Source§fn post_restart(&mut self, _ctx: &mut ActorContext, _reason: &str) -> Result<()>
fn post_restart(&mut self, _ctx: &mut ActorContext, _reason: &str) -> Result<()>
Called after the actor has restarted Read more
Source§fn supervisor_strategy(
&mut self,
_child: ActorId,
_reason: &str,
) -> SupervisorDirective
fn supervisor_strategy( &mut self, _child: ActorId, _reason: &str, ) -> SupervisorDirective
Handle actor supervision - called when a child actor fails
Auto Trait Implementations§
impl Freeze for EchoActor
impl RefUnwindSafe for EchoActor
impl Send for EchoActor
impl Sync for EchoActor
impl Unpin for EchoActor
impl UnwindSafe for EchoActor
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