pub struct Context<ACTOR> { /* fields omitted */ }
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).
Creates a new Context
object with default capacity (128 elements).
Creates a new Context
object with custom capacity.
Returns an address of the actor.
pub async fn run(self, actor: ACTOR)
[src]
Starts the message handling routine.
Future returned by this method should not normally be directly await
ed,
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.
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.