Trait theater::actor::Actor
[−]
[src]
pub trait Actor { type Message: Encodable + Decodable; fn recv(&mut self, m: Self::Message); }
Actor behavior is defined by an actor definition, which is any type
implementing the Actor
trait.
Associated Types
type Message: Encodable + Decodable
The type of messages this actor expects to receive. Incoming messages are automatically decoded to this type. Similarly, messages sent to this actor are encoded using this type. Decode or encode failures are considered a kind of message delivery failure.
Required Methods
fn recv(&mut self, m: Self::Message)
The heart of the actor, where messages are processed internally as state changes and produce zero or more actions.