Trait wactor::Actor[][src]

pub trait Actor: Sized {
    type Input: Serialize + DeserializeOwned;
    type Output: Serialize + DeserializeOwned;
    fn create() -> Self;
fn handle(&mut self, msg: Self::Input, link: &Link<Self>); }

Actors run on isolated green threads. The cannot share memory, and communicate only through input and output messages. Consequently messages must be serialized to travel between threads.

Associated Types

Loading content...

Required methods

fn create() -> Self[src]

Create this actor.

fn handle(&mut self, msg: Self::Input, link: &Link<Self>)[src]

Handle an input message.

Loading content...

Implementors

Loading content...