pub struct ActorHandle<A: Actor> { /* private fields */ }
Expand description

An Actor Handle serves as an address to communicate with an actor.

Implementations

Process all of the pending messages, and returns a snapshot of the observable state of the actor after this.

This method is mostly useful for tests.

To actually observe the state of an actor for ops purpose, prefer using the .observe() method.

This method timeout if reaching the end of the message takes more than an HEARTBEAT.

Pauses the actor. The actor will stop processing the message, but its work can be resumed by calling the method .resume().

Resumes a paused actor.

Kills the actor. Its finalize function will still be called.

This function also actionnates the actor kill switch.

The other difference with quit is the exit status. It is important, as the finalize logic may behave differently depending on the exit status.

Gracefully quit the actor, regardless of whether there are pending messages or not. Its finalize function will be called.

The kill switch is not actionated.

The other difference with kill is the exit status. It is important, as the finalize logic may behave differently depending on the exit status.

Waits until the actor exits by itself. This is the equivalent of Thread::join.

Observe the current state.

The observation will be scheduled as a command message, therefore it will be executed after the current active message and the current command queue have been processed.

Trait Implementations

Formats the value using the given formatter. 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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Should always be Self

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more