pub struct Receiver<T> { /* private fields */ }Expand description
Reusable receiver of a multi-shot channel.
A Receiver can be used to receive a value using the Future returned by
recv. It can also produce a one-shot Sender with the
sender method, provided that there is currently no
live sender.
A receiver can be created with the channel function or with the
new method.
Implementations§
Source§impl<T> Receiver<T>
impl<T> Receiver<T>
Sourcepub fn sender(&mut self) -> Option<Sender<T>>
pub fn sender(&mut self) -> Option<Sender<T>>
Returns a new sender if there is currently no live sender.
This operation is wait-free. It is guaranteed to succeed (i) on its
first invocation and (ii) on further invocations if the future returned
by recv has been awaited (i.e. polled to
completion) after the previous sender was created.
Trait Implementations§
impl<T> RefUnwindSafe for Receiver<T>
impl<T: Send> Send for Receiver<T>
impl<T: Send> Sync for Receiver<T>
impl<T> UnwindSafe for Receiver<T>
Auto Trait Implementations§
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