#[derive(Debug, Clone, Copy)]
pub enum TimerSignal {
Terminate,
NextSnapshot(u64),
}
impl std::fmt::Display for TimerSignal {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Terminate => write!(f, "Terminate"),
Self::NextSnapshot(when) => write!(f, "NextSnapshot({})", when),
}
}
}
#[cfg(target_os = "macos")]
pub mod kqueue;
#[cfg(target_os = "macos")]
pub use kqueue::Timer;
#[cfg(target_os = "linux")]
pub mod epoll;
#[cfg(target_os = "linux")]
pub use epoll::Timer;
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
pub mod sleep;
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
pub use sleep::Timer;