devela/work/sync/mpsc/
namespace.rs1#[cfg(feature = "std")]
7use crate::{MpscReceiver, MpscSender, MpscSyncSender};
8#[cfg(feature = "std")]
9use std::sync::mpsc::{channel, sync_channel};
10
11#[doc = crate::_tags!(concurrency namespace)]
12#[doc = crate::_doc_meta!{location("work/sync/mpsc")}]
14#[derive(Debug)]
15pub struct Mpsc;
16
17#[cfg(feature = "std")]
18#[cfg_attr(nightly_doc, doc(cfg(feature = "std")))]
19impl Mpsc {
20 #[must_use]
24 pub fn channel<T>() -> (MpscSender<T>, MpscReceiver<T>) {
25 channel()
26 }
27
28 #[must_use]
32 pub fn sync_channel<T>(bound: usize) -> (MpscSyncSender<T>, MpscReceiver<T>) {
33 sync_channel(bound)
34 }
35}