pub struct Channel<T> { /* private fields */ }Expand description
A bounded multi-producer multi-consumer channel.
Implementations§
Source§impl<T> Channel<T>
impl<T> Channel<T>
pub fn new(capacity: usize) -> Arc<Self>
Sourcepub fn try_send(&self, value: T) -> Result<(), ChannelError<T>>
pub fn try_send(&self, value: T) -> Result<(), ChannelError<T>>
Try to send a value.
Sourcepub fn try_recv(&self) -> Result<T, ChannelError<()>>
pub fn try_recv(&self) -> Result<T, ChannelError<()>>
Try to receive a value.
Sourcepub fn register_send_wait(&self, waker: Waker)
pub fn register_send_wait(&self, waker: Waker)
Register to wait for send.
Sourcepub fn register_recv_wait(&self, waker: Waker)
pub fn register_recv_wait(&self, waker: Waker)
Register to wait for receive.
Auto Trait Implementations§
impl<T> !Freeze for Channel<T>
impl<T> RefUnwindSafe for Channel<T>
impl<T> Send for Channel<T>where
T: Send,
impl<T> Sync for Channel<T>where
T: Send,
impl<T> Unpin for Channel<T>where
T: Unpin,
impl<T> UnsafeUnpin for Channel<T>
impl<T> UnwindSafe for Channel<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more