Trait agency::Actor[][src]

pub trait Actor: Send + Sync + Sized {
    type Msg: 'static + Send + Sync;
    #[must_use]
    fn run<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        ctx: &'life1 mut Context<Self>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; #[must_use] fn init<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _ctx: &'life1 mut Context<Self>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] fn stopping<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _ctx: &'life1 mut Context<Self>
    ) -> Pin<Box<dyn Future<Output = StoppingResult> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] fn stopped<'life0, 'async_trait>(
        self,
        _ctx: &'life0 mut Context<Self>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } }

Associated Types

type Msg: 'static + Send + Sync[src]

Required methods

#[must_use]
fn run<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    ctx: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Provided methods

#[must_use]
fn init<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    _ctx: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

#[must_use]
fn stopping<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    _ctx: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = StoppingResult> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Called after ctx.stop() is called.

Can be used to restart try and recover the actor and restart the run loop.

#[must_use]
fn stopped<'life0, 'async_trait>(
    self,
    _ctx: &'life0 mut Context<Self>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Implementors