#[non_exhaustive]pub enum TimerUnavailableError {
WorkerThreadSpawnFailed {
source: Error,
},
SchedulerWorkerTerminated,
TimeDriverDisabled,
RuntimeShuttingDown,
BackendUnavailable {
backend: &'static str,
source: Box<dyn StdError + Send + Sync + 'static>,
},
}Expand description
Describes a backend failure that prevented timer registration or completion.
Each variant preserves the most specific stable source exposed by its
backend. Custom Timer implementations should use
BackendUnavailable to retain their own error
rather than reducing it to display text. The enum is non-exhaustive; callers
must retain a fallback arm when matching it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
WorkerThreadSpawnFailed
The standard timer could not spawn its shared scheduler worker.
SchedulerWorkerTerminated
The standard timer scheduler worker exited before the deadline.
TimeDriverDisabled
tokio only.The target asynchronous runtime has no enabled time driver.
Tokio currently exposes this condition by panicking while creating a
future sleep. TokioTimer catches that unwind and
returns this variant, but the process panic hook runs before unwinding.
Consequently the hook may still log or otherwise observe the panic,
and a panic = "abort" build cannot convert it into this error.
RuntimeShuttingDown
tokio only.The target asynchronous runtime shut down before a pending timer future completed.
A custom timer backend is unavailable.
Trait Implementations§
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()