use std::{
error::Error as StdError,
io,
};
use thiserror::Error;
#[non_exhaustive]
#[derive(Debug, Error)]
pub enum TimerUnavailableError {
#[error("the scheduler worker thread could not be spawned: {source}")]
WorkerThreadSpawnFailed {
#[source]
source: io::Error,
},
#[error("the scheduler worker thread terminated unexpectedly")]
SchedulerWorkerTerminated,
#[cfg(feature = "tokio")]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
#[error("the asynchronous runtime time driver is disabled")]
TimeDriverDisabled,
#[cfg(feature = "tokio")]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
#[error(
"the asynchronous runtime shut down before the timer future completed"
)]
RuntimeShuttingDown,
#[error("timer backend '{backend}' is unavailable: {source}")]
BackendUnavailable {
backend: &'static str,
#[source]
source: Box<dyn StdError + Send + Sync + 'static>,
},
}