pub enum ActorExitStatus {
    Success,
    Quit,
    DownstreamClosed,
    Killed,
    Failure(Arc<Error>),
    Panicked,
}
Expand description

The actor exit status represents the outcome of the execution of an actor, after the end of the execution.

It is in many ways, similar to the exit status code of a program.

Variants

Success

The actor successfully exited.

It happens either because:

  • all of the existing mailboxes were dropped and the actor message queue was exhausted. No new message could ever arrive to the actor. (This exit is triggered by the framework.) or
  • the actor process_message method returned Err(ExitStatusCode::Success). (This exit is triggered by the actor implementer.)

(This is equivalent to exit status code 0.) Note that this is not really an error.

Quit

The actor was asked to gracefully shutdown.

(Semantically equivalent to exit status code 130, triggered by SIGINT aka Ctrl-C, or SIGQUIT)

DownstreamClosed

The actor tried to send a message to a dowstream actor and failed. The logic ruled that the actor should be killed.

(Semantically equivalent to exit status code 141, triggered by SIGPIPE)

Killed

The actor was killed.

It can happen because:

  • it received Command::Kill.
  • its kill switch was activated.

(Semantically equivalent to exit status code 137, triggered by SIGKILL)

Failure(Arc<Error>)

An unexpected error happened while processing a message.

Panicked

The thread or the task executing the actor loop panicked.

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Converts to this type from the input type.

Converts to this type from the input type.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

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