1 //! Asynchronous channels.
2 //!
3 //! Like threads, concurrent tasks sometimes need to communicate with each
4 //! other. This module contains two basic abstractions for doing so:
5 //!
6 //! - [oneshot], a way of sending a single value from one task to another.
7 //! - [mpsc], a multi-producer, single-consumer channel for sending values
8 //!   between tasks, analogous to the similarly-named structure in the standard
9 //!   library.
10 //!
11 //! All items are only available when the `std` or `alloc` feature of this
12 //! library is activated, and it is activated by default.
13 
14 #![no_std]
15 #![doc(test(
16     no_crate_inject,
17     attr(
18         deny(warnings, rust_2018_idioms, single_use_lifetimes),
19         allow(dead_code, unused_assignments, unused_variables)
20     )
21 ))]
22 #![warn(missing_docs, unsafe_op_in_unsafe_fn)]
23 
24 #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))]
25 #[cfg(feature = "alloc")]
26 extern crate alloc;
27 #[cfg(feature = "std")]
28 extern crate std;
29 
30 #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))]
31 #[cfg(feature = "alloc")]
32 mod lock;
33 #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))]
34 #[cfg(feature = "std")]
35 pub mod mpsc;
36 #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))]
37 #[cfg(feature = "alloc")]
38 pub mod oneshot;
39