Struct tonari_actor::Context[][src]

pub struct Context<M> {
    pub system_handle: SystemHandle,
    pub myself: Recipient<M>,
    // some fields omitted
}
Expand description

An execution context for a specific actor. Specifically, this is useful for managing the lifecycle of itself (through the myself field) and other actors via the SystemHandle provided. A time-based deadline for receiving a message can be set using Self::set_deadline() and friends.

Fields

system_handle: SystemHandlemyself: Recipient<M>

Implementations

Get the deadline previously set using Self::set_deadline() or Self::set_timeout(). The deadline is cleared just before Actor::deadline_passed() is called.

Schedule a future one-shot call to Actor::deadline_passed(), or cancel the schedule. A deadline in the past is considered to expire right in the next iteration (possibly after receiving new messages).

Schedule or cancel a call to Actor::deadline_passed() after timeout from now. Convenience variant of Self::set_deadline().

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.