• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //! Await
2 //!
3 //! This module contains a number of functions and combinators for working
4 //! with `async`/`await` code.
5 
6 use futures_core::future::{FusedFuture, Future};
7 use futures_core::stream::{FusedStream, Stream};
8 
9 #[macro_use]
10 mod poll;
11 #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/64762
12 pub use self::poll::*;
13 
14 #[macro_use]
15 mod pending;
16 #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/64762
17 pub use self::pending::*;
18 
19 // Primary export is a macro
20 #[cfg(feature = "async-await-macro")]
21 mod join_mod;
22 #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/64762
23 #[cfg(feature = "async-await-macro")]
24 pub use self::join_mod::*;
25 
26 // Primary export is a macro
27 #[cfg(feature = "async-await-macro")]
28 mod select_mod;
29 #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/64762
30 #[cfg(feature = "async-await-macro")]
31 pub use self::select_mod::*;
32 
33 // Primary export is a macro
34 #[cfg(feature = "async-await-macro")]
35 mod stream_select_mod;
36 #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/64762
37 #[cfg(feature = "async-await-macro")]
38 pub use self::stream_select_mod::*;
39 
40 #[cfg(feature = "std")]
41 #[cfg(feature = "async-await-macro")]
42 mod random;
43 #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/64762
44 #[cfg(feature = "std")]
45 #[cfg(feature = "async-await-macro")]
46 pub use self::random::*;
47 
48 #[doc(hidden)]
49 #[inline(always)]
assert_unpin<T: Unpin>(_: &T)50 pub fn assert_unpin<T: Unpin>(_: &T) {}
51 
52 #[doc(hidden)]
53 #[inline(always)]
assert_fused_future<T: Future + FusedFuture>(_: &T)54 pub fn assert_fused_future<T: Future + FusedFuture>(_: &T) {}
55 
56 #[doc(hidden)]
57 #[inline(always)]
assert_fused_stream<T: Stream + FusedStream>(_: &T)58 pub fn assert_fused_stream<T: Stream + FusedStream>(_: &T) {}
59