Skip to main content

RuntimeError

Enum RuntimeError 

Source
#[non_exhaustive]
pub enum RuntimeError { TokioRuntimeUnavailable,
#[non_exhaustive]
ThreadStartFailed { component: &'static str, source: Error, },
#[non_exhaustive]
GraceExceeded { grace: Duration, stuck: Vec<Arc<str>>, },
#[non_exhaustive]
TaskAlreadyExists { name: Arc<str>, },
#[non_exhaustive]
ResourceLimitReached { resource: &'static str, limit: usize, }, CommandQueueFull,
#[non_exhaustive]
TaskTerminationTimeout { id: TaskId, timeout: Duration, },
#[non_exhaustive]
OutcomeUnavailable { id: TaskId, },
#[non_exhaustive]
SignalSetupFailed { source: Error, }, ShuttingDown, AlreadyRunning, }
Expand description

Failure of a supervisor lifecycle or management operation.

Runtime startup, static runs, dynamic management, outcome waiting, and shutdown return this type. Task attempts return TaskError instead. This enum and its data-carrying variants are non-exhaustive; keep a fallback arm and use .. when matching fields.

§See also

  • Error combines runtime and feature-gated controller errors.
  • ControllerError - controller availability and submission intake errors

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.
§

TokioRuntimeUnavailable

Runtime startup was requested without an active Tokio runtime.

The supervisor remains stopped and startup may be retried from inside a Tokio runtime.

§

#[non_exhaustive]
ThreadStartFailed

A required Taskvisor worker thread could not start.

The operation that needed the worker remains uncommitted. The source identifies the failed thread-creation or startup handshake.

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.
§component: &'static str

Stable runtime component name suitable for diagnostics.

§source: Error

I/O error from thread creation or the transactional startup handshake.

§

#[non_exhaustive]
GraceExceeded

Task cleanup did not finish within the shared shutdown grace period.

A listed name belongs to an actor that required logical force-abort or a removal owner still finishing at the deadline. A force-aborted actor can remain physically active under Taskvisor’s cleanup ownership after this error is returned.

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 whose removal did not finish within the grace period.

§

#[non_exhaustive]
TaskAlreadyExists

A task name is already reserved or repeated in an atomic static batch.

Registry membership and cleanup ownership of a physically active force-aborted actor can both reserve a name.

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>

Conflicting task name.

§

#[non_exhaustive]
ResourceLimitReached

A configured runtime or user-lifetime budget was exhausted.

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.
§resource: &'static str

Stable resource name used by diagnostics.

§limit: usize

Reported bound for the rejected resource. For owned_user_lifetimes, this is the domain’s configured capacity; retired poisoned slots can make the currently usable capacity smaller.

§

CommandQueueFull

A fail-fast management call found its command queue full.

The rejected request does not change task or controller-slot ownership.

§

#[non_exhaustive]
TaskTerminationTimeout

The caller’s bounded wait for terminal registry cleanup expired.

The stop request remains active. This error does not undo cancellation or change the supervisor’s shutdown 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 whose terminal cleanup remained pending.

§timeout: Duration

Wait duration before timing out.

§

#[non_exhaustive]
OutcomeUnavailable

A watched task or controller submission’s direct outcome channel closed without a result.

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 identity whose outcome could not be delivered.

§

#[non_exhaustive]
SignalSetupFailed

Explicit operating-system signal setup failed.

This can only come from Supervisor::run_with_os_signals. Every caller joining that shared shutdown receives an equivalent source.

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

A static run tried to acquire an already owned or committed lifecycle.

Supervisor::run, Supervisor::run_until, and Supervisor::run_with_os_signals share one single-shot lifecycle.

Implementations§

Source§

impl RuntimeError

Source

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

Returns the stable category label used by 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