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

The type of message the actor can receive.

Required Methods

A handler to receive messages from the channel. Returning 'true' will signal that this actor has completed.

Implementors