pub fn start<F>(f: F) -> Addr<A>
    where
        F: FnOnce(&mut A::Context) -> A + 'static,
        A: Actor<Context = Context<A>>,
    {
        // create actor
        let mut ctx = Context::new();
        let act = f(&mut ctx);
        let addr = ctx.address();
        let fut = ctx.into_future(act);

        // create supervisor
        actix_rt::spawn(Self { fut });

        addr
    }
/// Start new supervised actor in current tokio runtime.
///
/// Type of returned address depends on variable type. For example to get
/// `Addr<Syn, _>` of newly created actor, use explicitly `Addr<Syn,
/// _>` type as type of a variable.
///
/// ```
/// # use actix::prelude::*;
/// struct MyActor;
///
/// impl Actor for MyActor {
///     type Context = Context<Self>;
/// }
///
/// # impl actix::Supervised for MyActor {}
/// # fn main() {
/// #    System::new().block_on(async {
/// // Get `Addr` of a MyActor actor
/// let addr = actix::Supervisor::start(|_| MyActor);
/// #         System::current().stop();
/// # });}
/// ```
Start new supervised actor in current tokio runtime.
Type of returned address depends on variable type. For example to get
`Addr` of newly created actor, use explicitly `Addr` type as type of a variable.


Start new supervised actor in current tokio runtime . Type of returned address depends on variable type . For example to get ` Addr ` of newly created actor use explicitly ` Addr ` type as type of a variable .
pub fn start<F>(f: F) -> Addr<A>
    where
        F: FnOnce(&mut A::Context) -> A + 'static,
        A: Actor<Context = Context<A>>,
    {
        // create actor
        let mut ctx = Context::new();
        let act = f(&mut ctx);
        let addr = ctx.address();
        let fut = ctx.into_future(act);
        // create supervisor
        actix_rt::spawn(Self { fut });
        addr
    }
pub fn start < F > ( f : F ) -> Addr < A > where F : FnOnce ( & mut A :: Context ) -> A + ' static , A : Actor < Context = Context < A > > , { // create actor let mut ctx = Context :: new ( ) ; let act = f ( & mut ctx ) ; let addr = ctx . address ( ) ; let fut = ctx . into_future ( act ) ; // create supervisor actix_rt :: spawn ( Self { fut } ) ; addr }
Start new supervised actor in current tokio runtime.
Start new supervised actor in current tokio runtime .
f
F
f
F
use actix::prelude::*;
struct MyActor.

impl Actor for MyActor {
type Context = Context;
}
struct MyActor . impl Actor for MyActor { type Context = Context ; }
impl actix::supervised for myactor {}
None
fn main() {
None
system::new().block_on(async {
Get `Addr` of a MyActor actor
let addr = actix::Supervisor::start(|_| MyActor).
Get ` Addr ` of a MyActor actor let addr = actix :: Supervisor :: start ( |_| MyActor ) .
system::current().stop();
None
});}
None