Trait actress::Actor
[−]
[src]
pub trait Actor { type MessageType: Send + 'static; fn recv(&mut self, msg: Self::MessageType) -> bool; }
Trait required to be compatible as an actor
Examples
use actress; struct NullActor; impl actress::Actor for NullActor { type MessageType = i32; fn recv(&mut self, msg: i32) -> bool { msg == 42 } }
Associated Types
type MessageType: Send + 'static
The type of message the actor can receive.
Required Methods
fn recv(&mut self, msg: Self::MessageType) -> bool
A handler to receive messages from the channel. Returning 'true' will signal that this actor has completed.