Files
tokio/tokio-test/src/lib.rs
T

38 lines
997 B
Rust
Raw Normal View History

2019-08-29 12:59:10 -07:00
#![doc(html_root_url = "https://docs.rs/tokio-test/0.2.0-alpha.4")]
#![warn(
2019-05-14 10:27:36 -07:00
missing_debug_implementations,
missing_docs,
rust_2018_idioms,
unreachable_pub
2019-05-14 10:27:36 -07:00
)]
2019-09-13 06:46:19 -10:00
#![deny(intra_doc_link_resolution_failure)]
2019-05-14 10:27:36 -07:00
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
2019-04-23 23:17:57 -04:00
//! Tokio and Futures based testing utilites
2019-06-30 08:48:53 -07:00
pub mod clock;
2019-07-11 14:41:37 -07:00
pub mod io;
2019-04-23 23:17:57 -04:00
mod macros;
pub mod task;
2019-05-03 20:43:40 -07:00
/// Runs the provided future, blocking the current thread until the
/// future completes.
///
/// For more information, see the documentation for
/// [`tokio::runtime::current_thread::Runtime::block_on`][runtime-block-on].
///
/// [runtime-block-on]: https://docs.rs/tokio/0.2.0-alpha.2/tokio/runtime/current_thread/struct.Runtime.html#method.block_on
pub fn block_on<F: std::future::Future>(future: F) -> F::Output {
let mut rt = tokio::runtime::current_thread::Runtime::new().unwrap();
rt.block_on(future)
}
2019-06-24 12:34:30 -07:00
/*
2019-05-03 20:43:40 -07:00
#[doc(hidden)]
pub mod codegen {
pub mod futures {
pub use futures::*;
}
}
2019-06-24 12:34:30 -07:00
*/