tokio_by_hand/
lib.rs

1#[macro_use]
2extern crate futures;
3extern crate rand;
4extern crate tokio_core;
5extern crate void;
6
7/// Common types used all over the place
8pub mod common {
9  pub use futures::prelude::*;
10  pub use futures::task;
11  pub use futures::task::Task;
12  pub use rand::random;
13  pub use std::cell::RefCell;
14  pub use std::collections::{HashSet, VecDeque};
15  pub use std::sync::Arc;
16  pub use std::sync::atomic::{AtomicBool, Ordering};
17  pub use std::thread;
18  pub use std::time::{Duration, Instant};
19  pub use std::{fmt, io};
20  pub use tokio_core::reactor::Core;
21  pub use void::Void;
22}
23
24/// An extended API version of `try_ready!`
25macro_rules! extended_try_ready {
26  ( $x:expr ) => {
27    {
28      match $x {
29        Ok(ExtendedAsync::Ready(t)) => t,
30        Ok(ExtendedAsync::NotReady(agreement_to_notify)) => {
31          return Ok(ExtendedAsync::NotReady(agreement_to_notify));
32        }
33        Err(err) => {
34          return Err(err);
35        }
36      }
37    }
38  };
39}
40
41/// Simple Futures, Sinks, and Streams using the standard futures API
42pub mod standard;
43
44/// Simple Futures, Sinks, and Streams using the extended futures API
45pub mod extended;
46