pub trait RuntimeActorExt: Actor {
// Provided methods
fn spawn(self) -> Address<Self> { ... }
fn create_and_spawn<F>(f: F) -> Address<Self>
where F: FnOnce(&Context<Self>) -> Self + Send { ... }
}
Available on crate features
runtime-tokio
or runtime-async-std
only.Expand description
Extension trait for Actor
providing more convenient interface when
one of the runtime features is enabled.
Provided Methods§
Sourcefn spawn(self) -> Address<Self>
fn spawn(self) -> Address<Self>
Spawns an actor using supported runtime.
Returns an address of this actor.
Sourcefn create_and_spawn<F>(f: F) -> Address<Self>
fn create_and_spawn<F>(f: F) -> Address<Self>
Same as Actor::create_and_run
, but spawns
the future instead of returning it.
Returns an address of this actor.
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.