pub struct Context<ACTOR> { /* private fields */ }
Expand description

Context represents an environment in which actor is being executed.

It is capable of transferring incoming messages to the actor, providing actor’s address and managing it lifetime (e.g. stopping it).

Implementations

Creates a new Context object with default capacity (128 elements).

Creates a new Context object with custom capacity.

Returns an address of the actor.

Starts the message handling routine.

Future returned by this method should not normally be directly awaited, but rather is expected to be used in some kind of spawn function of the used runtime (e.g. tokio::spawn or async_std::task::spawn).

This is supported on crate features runtime-tokio or runtime-async-std only.

Spawns an actor and returns its address.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a 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

Performs the conversion.

Performs the conversion.

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.