Trait overclock::core::Actor

source ·
pub trait Actor<S>: Sized + Sendwhere
    S: Send,
{ type Data: Send + 'static; type Channel: Channel; const VERSION: usize = 1usize; fn init<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        rt: &'life1 mut Rt<Self, S>
    ) -> Pin<Box<dyn Future<Output = ActorResult<Self::Data>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn run<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        rt: &'life1 mut Rt<Self, S>,
        data: Self::Data
    ) -> Pin<Box<dyn Future<Output = ActorResult<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn type_name() -> &'static str { ... } }
Expand description

The all-important Actor trait. This defines an Actor and what it do.

Required Associated Types§

Allows specifying an actor’s startup dependencies and data.

The type of channel this actor will use to receive events

Provided Associated Constants§

The version of the actor state

Required Methods§

Used to initialize the actor.

The main function for the actor

Provided Methods§

Get this actor’s type name

Implementors§