use std::fmt;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum TimerError {
DelayTooLong { delay: u64, max: u64 },
}
impl fmt::Display for TimerError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
TimerError::DelayTooLong { delay, max } => {
write!(
f,
"delay {delay} ticks exceeds the wheel capacity of {max} ticks"
)
}
}
}
}
impl std::error::Error for TimerError {}
#[cfg(test)]
#[path = "error_tests.rs"]
mod tests;