1#![deny(clippy::pedantic)]
3#![allow(
4 clippy::missing_fields_in_debug,
5 clippy::must_use_candidate,
6 clippy::missing_errors_doc
7)]
8
9mod arbiter;
10mod builder;
11mod driver;
12mod handle;
13mod pool;
14mod system;
15mod task;
16
17mod rt;
18pub mod rt_default;
19
20#[cfg(feature = "compio")]
21pub mod rt_compio;
22#[cfg(feature = "tokio")]
23pub mod rt_tokio;
24
25pub use self::arbiter::Arbiter;
26pub use self::builder::{Builder, SystemRunner};
27pub use self::driver::{BlockFuture, Driver, DriverType, Notify, PollResult, Runner};
28pub use self::pool::{BlockingError, BlockingResult};
29pub use self::rt::{Runtime, RuntimeBuilder};
30pub use self::system::{Id, PingRecord, System};
31pub use self::task::{task_callbacks, task_opt_callbacks};
32
33pub fn spawn_blocking<F, R>(f: F) -> BlockingResult<R>
37where
38 F: FnOnce() -> R + Send + 'static,
39 R: Send + 'static,
40{
41 System::current().spawn_blocking(f)
42}
43
44#[cfg(feature = "tokio")]
45pub use self::rt_tokio::*;
46
47#[cfg(all(feature = "compio", not(feature = "tokio")))]
48pub use self::rt_compio::*;
49
50#[cfg(all(not(feature = "tokio"), not(feature = "compio")))]
51pub use self::rt_default::*;