pub struct System { /* private fields */ }
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

Creates a new System with a given name.

Prepare an actor to be spawned. Returns a SpawnBuilder which can be used to customize the spawning of the actor.

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.

Subscribe given recipient to events of type E. See Context::subscribe().

Publish an event. All actors that have previously subscribed to the type will receive it.

When sending to some subscriber fails, others are still tried and vec of errors is returned. For direct, non-Clone or high-throughput messages please use Addr or Recipient.

Trait Implementations

Returns the “default value” for a type. Read more

The resulting type after dereferencing.

Dereferences the value.

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.