2018-03-28 22:26:47 -07:00
|
|
|
//! Utilities for scheduling work to happen after a period of time.
|
|
|
|
|
//!
|
|
|
|
|
//! This crate provides a number of utilities for working with periods of time:
|
|
|
|
|
//!
|
2018-03-30 14:21:48 -07:00
|
|
|
//! * [`Delay`]: A future that completes at a specified instant in time.
|
2018-03-28 22:26:47 -07:00
|
|
|
//!
|
|
|
|
|
//! * [`Interval`] A stream that yields at fixed time intervals.
|
|
|
|
|
//!
|
|
|
|
|
//! * [`Deadline`]: Wraps a future, requiring it to complete before a specified
|
|
|
|
|
//! instant in time, erroring if the future takes too long.
|
|
|
|
|
//!
|
|
|
|
|
//! These three types are backed by a [`Timer`] instance. In order for
|
2018-03-30 14:21:48 -07:00
|
|
|
//! [`Delay`], [`Interval`], and [`Deadline`] to function, the associated
|
2018-03-28 22:26:47 -07:00
|
|
|
//! [`Timer`] instance must be running on some thread.
|
|
|
|
|
//!
|
2018-03-30 14:21:48 -07:00
|
|
|
//! [`Delay`]: struct.Delay.html
|
2018-03-28 22:26:47 -07:00
|
|
|
//! [`Deadline`]: struct.Deadline.html
|
|
|
|
|
//! [`Interval`]: struct.Interval.html
|
|
|
|
|
//! [`Timer`]: timer/struct.Timer.html
|
|
|
|
|
|
|
|
|
|
#![doc(html_root_url = "https://docs.rs/tokio-timer/0.2.0")]
|
|
|
|
|
#![deny(missing_docs, warnings, missing_debug_implementations)]
|
|
|
|
|
|
|
|
|
|
extern crate tokio_executor;
|
|
|
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
|
extern crate futures;
|
|
|
|
|
|
|
|
|
|
pub mod timer;
|
|
|
|
|
|
|
|
|
|
mod atomic;
|
|
|
|
|
mod deadline;
|
2018-03-30 14:21:48 -07:00
|
|
|
mod delay;
|
2018-03-28 22:26:47 -07:00
|
|
|
mod error;
|
|
|
|
|
mod interval;
|
|
|
|
|
|
|
|
|
|
pub use self::deadline::{Deadline, DeadlineError};
|
2018-03-30 14:21:48 -07:00
|
|
|
pub use self::delay::Delay;
|
2018-03-28 22:26:47 -07:00
|
|
|
pub use self::error::Error;
|
|
|
|
|
pub use self::interval::Interval;
|
|
|
|
|
pub use self::timer::{Timer, with_default};
|