Actor

Trait Actor 

Source
pub trait Actor:
    'static
    + Sized
    + Send {
    type Context;

    // Provided method
    fn start(self) -> Addr<Self> { ... }
}
Expand description

Actor reacts to messages. See Handler for how to define the reaction.

Required Associated Types§

Source

type Context

The Actor’s running context. Should be Context<Self>.

Provided Methods§

Source

fn start(self) -> Addr<Self>

Starts running this Actor and returns an Addr to it.

The Addr can be cloned for sending messages to the Actor from different threads.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§