pub struct UnboundedReceiver<T>(/* private fields */);
Expand description
The receiving end of an unbounded mpsc channel.
This value is created by the unbounded
function.
Implementations§
Source§impl<T> UnboundedReceiver<T>
impl<T> UnboundedReceiver<T>
Sourcepub fn close(&mut self)
pub fn close(&mut self)
Closes the receiving half of the 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.
Sourcepub fn try_next(&mut self) -> Result<Option<T>, TryRecvError>
pub fn try_next(&mut self) -> Result<Option<T>, TryRecvError>
Tries to receive the next message without notifying a context if empty.
It is not recommended to call this function from inside of a future, only when you’ve otherwise arranged to be notified when the channel is no longer empty.
Trait Implementations§
Source§impl<T: Debug> Debug for UnboundedReceiver<T>
impl<T: Debug> Debug for UnboundedReceiver<T>
Source§impl<T> Drop for UnboundedReceiver<T>
impl<T> Drop for UnboundedReceiver<T>
Source§impl<T> Stream for UnboundedReceiver<T>
impl<T> Stream for UnboundedReceiver<T>
Auto Trait Implementations§
impl<T> Freeze for UnboundedReceiver<T>
impl<T> !RefUnwindSafe for UnboundedReceiver<T>
impl<T> Send for UnboundedReceiver<T>where
T: Send,
impl<T> Sync for UnboundedReceiver<T>where
T: Send,
impl<T> Unpin for UnboundedReceiver<T>
impl<T> !UnwindSafe for UnboundedReceiver<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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more