use core::{task, time};
use core::marker::Unpin;
use core::future::Future;
pub trait Oneshot: Send + Sync + Unpin + Future<Output=()> {
fn new(timeout: time::Duration) -> Self;
fn is_ticking(&self) -> bool;
fn is_expired(&self) -> bool;
fn cancel(&mut self);
fn restart(&mut self, timeout: time::Duration, waker: &task::Waker);
}
mod state;
#[cfg(target_arch = "wasm32")]
pub mod web;
#[cfg(windows)]
pub mod win;
#[cfg(all(unix, not(any(target_os = "macos", target_os = "ios"))))]
pub mod posix;
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub mod apple;
#[cfg(all(feature = "tokio_on", any(target_os = "linux", target_os = "android")))]
pub mod timer_fd;
#[cfg(all(feature = "tokio_on", any(target_os = "bitrig", target_os = "dragonfly", target_os = "freebsd", target_os = "ios", target_os = "macos", target_os = "netbsd", target_os = "openbsd")))]
pub mod kqueue;
pub mod dummy;
mod extra;
pub use extra::NeverTimer;
#[cfg(all(feature = "tokio_on", any(target_os = "linux", target_os = "android")))]
pub use timer_fd::TimerFd;
#[cfg(target_arch = "wasm32")]
pub type Timer = web::WebTimer;
#[cfg(windows)]
pub type Timer = win::WinTimer;
#[cfg(all(not(feature = "tokio_on"), not(any(target_os = "macos", target_os = "ios")), unix))]
pub type Timer = posix::PosixTimer;
#[cfg(all(feature = "tokio_on", any(target_os = "linux", target_os = "android")))]
pub type Timer = timer_fd::TimerFd;
#[cfg(all(not(feature = "tokio_on"), any(target_os = "macos", target_os = "ios")))]
pub type Timer = apple::AppleTimer;
#[cfg(all(feature = "tokio_on", any(target_os = "bitrig", target_os = "dragonfly", target_os = "freebsd", target_os = "ios", target_os = "macos", target_os = "netbsd", target_os = "openbsd")))]
pub type Timer = kqueue::KqueueTimer;
#[cfg(not(any(
windows, target_arch = "wasm32", unix,
all(feature = "tokio_on", any(target_os = "bitrig", target_os = "ios", target_os = "macos"))
)))]
pub type Timer = dummy::DummyTimer;