Files
tokio/tokio-async-await/src/lib.rs
T

36 lines
1.0 KiB
Rust
Raw Normal View History

2018-09-26 10:10:47 -07:00
#![cfg(feature = "async-await-preview")]
#![feature(rust_2018_preview, async_await, await_macro, futures_api)]
2019-02-22 17:15:42 -08:00
#![doc(html_root_url = "https://docs.rs/tokio-async-await/0.1.6")]
#![deny(missing_docs, missing_debug_implementations)]
#![cfg_attr(test, deny(warnings))]
//! A preview of Tokio w/ `async` / `await` support.
extern crate futures;
2018-09-26 10:10:47 -07:00
extern crate tokio_io;
/// Extracts the successful type of a `Poll<Result<T, E>>`.
///
/// This macro bakes in propagation of `Pending` and `Err` signals by returning early.
macro_rules! try_ready {
($x:expr) => {
match $x {
std::task::Poll::Ready(Ok(x)) => x,
2019-02-21 11:56:15 -08:00
std::task::Poll::Ready(Err(e)) => return std::task::Poll::Ready(Err(e.into())),
std::task::Poll::Pending => return std::task::Poll::Pending,
2018-09-26 10:10:47 -07:00
}
2019-02-21 11:56:15 -08:00
};
}
2018-09-26 10:10:47 -07:00
#[macro_use]
mod await;
pub mod compat;
pub mod io;
pub mod sink;
pub mod stream;
2018-09-26 10:10:47 -07:00
// Rename the `await` macro in `std`. This is used by the redefined
// `await` macro in this crate.
#[doc(hidden)]
pub use std::await as std_await;