Actor

Trait Actor 

Source
pub trait Actor<'a, A, M>: Send + 'static {
    type Out: Into<Exit>;
    type Fut: Future<Output = Self::Out> + Send + 'a;

    // Required method
    fn run(self, context: &'a mut Context<M>, args: A) -> Self::Fut;
}
Expand description

A marker trait for actor behaviour function.

It is recommended to rely on the existing implementation of this trait for certain async-functions, rather than implementing this trait manually.

Required Associated Types§

Source

type Out: Into<Exit>

Source

type Fut: Future<Output = Self::Out> + Send + 'a

Required Methods§

Source

fn run(self, context: &'a mut Context<M>, args: A) -> Self::Fut

Implementors§

Source§

impl<'a, A, M, F, Fut, Out> Actor<'a, A, M> for F
where M: 'a, F: FnOnce(&'a mut Context<M>, A) -> Fut + Send + 'static, Fut: Future<Output = Out> + 'a + Send, Out: Into<Exit>,

Source§

type Out = Out

Source§

type Fut = Fut