ActorRunExt

Trait ActorRunExt 

Source
pub trait ActorRunExt {
    type Env;
    type Msg;

    // Required methods
    fn handle_call_or_cast(
        &mut self,
        msg: Self::Msg,
        env: &mut Self::Env,
    ) -> impl Future<Output = Result<()>>;
    fn handle_continuously(
        &mut self,
        env: &mut Self::Env,
    ) -> impl Future<Output = Result<()>>;
    fn run_and_handle_exit(
        &mut self,
        env: &mut Self::Env,
    ) -> impl Future<Output = Result<()>>;
    fn run_till_exit(
        &mut self,
        env: &mut Self::Env,
    ) -> impl Future<Output = Result<()>>;
}
Expand description

Provides convenience methods for running Actor instances. Not intended for users.

This trait is not object-safe.
use tokio_gen_server::actor::ActorRunExt;
let _: Box<dyn ActorRunExt<Env = (), Msg = ()>>;

Required Associated Types§

Required Methods§

Source

fn handle_call_or_cast( &mut self, msg: Self::Msg, env: &mut Self::Env, ) -> impl Future<Output = Result<()>>

Source

fn handle_continuously( &mut self, env: &mut Self::Env, ) -> impl Future<Output = Result<()>>

Source

fn run_and_handle_exit( &mut self, env: &mut Self::Env, ) -> impl Future<Output = Result<()>>

Source

fn run_till_exit( &mut self, env: &mut Self::Env, ) -> impl Future<Output = Result<()>>

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§

Source§

impl<A> ActorRunExt for A
where A: Actor, ActorMsg<A>: Send,

Source§

type Env = Env<<A as Actor>::Call, <A as Actor>::Cast, <A as Actor>::Reply>

Source§

type Msg = Msg<<A as Actor>::Call, <A as Actor>::Cast, <A as Actor>::Reply>