#![warn(missing_docs)]
#![no_std]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::style))]
#[allow(unused_imports)]
extern crate alloc;
#[cfg(not(feature = "no_std"))]
extern crate std;
use core::{time, future};
#[macro_use]
mod utils;
pub mod oneshot;
mod timed;
mod interval;
pub use oneshot::Oneshot;
pub use timed::{Timed, Expired};
pub use interval::Interval;
pub fn timed<F: future::Future>(job: F, timeout: time::Duration) -> impl future::Future<Output=Result<F::Output, Expired<F, oneshot::Timer>>> {
unsafe {
Timed::platform_new_unchecked(job, timeout)
}
}
pub fn interval(interval: time::Duration) -> Interval<oneshot::Timer> {
Interval::platform_new(interval)
}