Skip to main content

RuntimeError

Enum RuntimeError 

Source
#[non_exhaustive]
pub enum RuntimeError {
#[non_exhaustive]
GraceExceeded { grace: Duration, stuck: Vec<Arc<str>>, },
#[non_exhaustive]
TaskAlreadyExists { name: Arc<str>, }, CommandQueueFull,
#[non_exhaustive]
TaskTerminationTimeout { id: TaskId, timeout: Duration, },
#[non_exhaustive]
SignalSetupFailed { source: Error, }, ShuttingDown, AlreadyRunning, }
Expand description

Errors from supervisor lifecycle and management operations.

These errors come from add, remove, cancel, shutdown, and run operations. They are separate from TaskError, which comes from a task attempt.

Match with a wildcard arm because this enum is non-exhaustive. Data-carrying variants are also non-exhaustive; include .. when matching their fields.

§Also

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

#[non_exhaustive]
GraceExceeded

Shutdown grace period was exceeded.

Some managed task runners did not stop in time and were force-terminated. Work detached by user code is outside this guarantee.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§grace: Duration

Configured shutdown grace duration.

§stuck: Vec<Arc<str>>

Task names that did not stop in time.

§

#[non_exhaustive]
TaskAlreadyExists

A task name is already registered or repeated in an all-or-nothing batch.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§name: Arc<str>

Duplicate task name.

§

CommandQueueFull

A bounded management command queue has no free capacity.

A fail-fast management call could not enqueue its requested state change. That request does not change task or slot ownership.

§

#[non_exhaustive]
TaskTerminationTimeout

Timed out while waiting for terminal registry cleanup.

The stop request remains active. This error only ends the caller’s wait; it does not undo cancellation or change the supervisor grace period.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§id: TaskId

Task id whose terminal cleanup did not finish in time.

§timeout: Duration

Wait duration before timing out.

§

#[non_exhaustive]
SignalSetupFailed

OS signal listener setup failed.

Signal-based shutdown is unavailable. The I/O error kind, message, and source chain are preserved for callers that join the shared shutdown operation.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§source: Error

I/O error returned by signal registration.

§

ShuttingDown

The runtime is shutting down and no longer accepts commands.

§

AlreadyRunning

Supervisor::run was called more than once.

A supervisor run is single-shot.

Implementations§

Source§

impl RuntimeError

Source

pub fn as_label(&self) -> &'static str

Returns a stable machine-readable label for logs and metrics.

This label is not the same as Display.

Trait Implementations§

Source§

impl Debug for RuntimeError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for RuntimeError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for RuntimeError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<RuntimeError> for Error

Source§

fn from(source: RuntimeError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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