futures_intrusive/channel/
mod.rs

1//! Asynchronous channels.
2//!
3//! This module provides various channels that can be used to communicate between
4//! asynchronous tasks.
5
6mod error;
7pub use self::error::{ChannelSendError, TryReceiveError, TrySendError};
8
9mod channel_future;
10use channel_future::{
11    ChannelReceiveAccess, ChannelSendAccess, RecvPollState, RecvWaitQueueEntry,
12    SendPollState, SendWaitQueueEntry,
13};
14pub use channel_future::{
15    ChannelReceiveFuture, ChannelSendFuture, CloseStatus,
16};
17
18mod oneshot;
19
20pub use self::oneshot::{GenericOneshotChannel, LocalOneshotChannel};
21
22#[cfg(feature = "std")]
23pub use self::oneshot::OneshotChannel;
24
25mod oneshot_broadcast;
26
27pub use self::oneshot_broadcast::{
28    GenericOneshotBroadcastChannel, LocalOneshotBroadcastChannel,
29};
30
31#[cfg(feature = "std")]
32pub use self::oneshot_broadcast::OneshotBroadcastChannel;
33
34mod state_broadcast;
35pub use state_broadcast::{
36    GenericStateBroadcastChannel, LocalStateBroadcastChannel, StateId,
37    StateReceiveFuture,
38};
39
40#[cfg(feature = "std")]
41pub use self::state_broadcast::StateBroadcastChannel;
42
43mod mpmc;
44
45pub use self::mpmc::{
46    ChannelStream, GenericChannel, LocalChannel, LocalUnbufferedChannel,
47};
48
49#[cfg(feature = "std")]
50pub use self::mpmc::{Channel, UnbufferedChannel};
51
52#[cfg(feature = "alloc")]
53mod if_alloc {
54
55    /// Channel implementations where Sender and Receiver sides are cloneable
56    /// and owned.
57    /// The Futures produced by channels in this module don't require a lifetime
58    /// parameter.
59    pub mod shared {
60        pub use super::super::channel_future::shared::*;
61        pub use super::super::mpmc::shared::*;
62        pub use super::super::oneshot::shared::*;
63        pub use super::super::oneshot_broadcast::shared::*;
64        pub use super::super::state_broadcast::shared::*;
65    }
66}
67
68#[cfg(feature = "alloc")]
69pub use self::if_alloc::*;