pub struct Receiver<T> { /* private fields */ }Expand description
The receiving end of a channel which implements the Stream trait.
This is created by the channel function.
Implementations§
Source§impl<T> Receiver<T>
impl<T> Receiver<T>
Sourcepub fn close(&self)
pub fn close(&self)
Closes the receiving half of a channel, without dropping it.
This prevents any further messages from being sent on the channel while still enabling the receiver to drain messages that are buffered.
Trait Implementations§
Source§impl<T> FusedStream for Receiver<T>
impl<T> FusedStream for Receiver<T>
Source§fn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
Returns true once the channel is closed and every buffered message
has been received.
Source§impl<T> Stream for Receiver<T>
impl<T> Stream for Receiver<T>
Source§fn poll_next(
self: Pin<&mut Receiver<T>>,
cx: &mut Context<'_>,
) -> Poll<Option<<Receiver<T> as Stream>::Item>>
fn poll_next( self: Pin<&mut Receiver<T>>, cx: &mut Context<'_>, ) -> Poll<Option<<Receiver<T> as Stream>::Item>>
Attempt to pull out the next value of this stream, registering the
current task for wakeup if the value is not yet available, and returning
None if the stream is exhausted. Read moreimpl<T> Unpin for Receiver<T>
impl<T> UnwindSafe for Receiver<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Receiver<T>
impl<T> !Send for Receiver<T>
impl<T> !Sync for Receiver<T>
impl<T> Freeze for Receiver<T>
impl<T> UnsafeUnpin for Receiver<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