Struct tonari_actor::System [−][src]
pub struct System { /* fields omitted */ }Expand description
Systems are responsible for keeping track of their spawned actors, and managing their lifecycles appropriately.
You may run multiple systems in the same application, each system being responsible for its own pool of actors.
Implementations
pub fn prepare<A>(
&mut self,
actor: A
) -> SpawnBuilder<'_, A, impl FnOnce() -> A> where
A: Actor + 'static,
pub fn prepare<A>(
&mut self,
actor: A
) -> SpawnBuilder<'_, A, impl FnOnce() -> A> where
A: Actor + 'static,
Prepare an actor to be spawned. Returns a SpawnBuilder
which can be used to customize the spawning of the actor.
pub fn prepare_fn<A, F>(&mut self, factory: F) -> SpawnBuilder<'_, A, F> where
A: Actor + 'static,
F: FnOnce() -> A + Send + 'static,
pub fn prepare_fn<A, F>(&mut self, factory: F) -> SpawnBuilder<'_, A, F> where
A: Actor + 'static,
F: FnOnce() -> A + Send + 'static,
Similar to prepare, but an actor factory is passed instead
of an Actor itself. This is used when an actor needs to be
created on its own thread instead of the calling thread.
Returns a SpawnBuilder which can be used to customize the
spawning of the actor.
Spawn a normal Actor in the system, returning its address when successful.
Block the current thread until the system is shutdown.
Methods from Deref<Target = SystemHandle>
Stops all actors spawned by this system.
Trait Implementations
type Target = SystemHandle
type Target = SystemHandle
The resulting type after dereferencing.