pub struct WeightedReceiver<T> { /* private fields */ }Expand description
The receiving half of a weighted channel.
Dropping the receiver closes the channel: any producer waiting for room in
WeightedSender::send wakes with SendError::Closed.
Implementations§
Source§impl<T> WeightedReceiver<T>
impl<T> WeightedReceiver<T>
Sourcepub async fn recv(&mut self) -> Option<Lease<T>>
pub async fn recv(&mut self) -> Option<Lease<T>>
Receive the next message, or None once every sender is dropped and the
channel is drained.
The returned Lease holds the message’s budget until it is dropped, so
hold it while the message is in use, or call Lease::into_inner to take
the value and free the budget now.
Trait Implementations§
Source§impl<T> Debug for WeightedReceiver<T>
impl<T> Debug for WeightedReceiver<T>
Source§impl<T> Drop for WeightedReceiver<T>
impl<T> Drop for WeightedReceiver<T>
Auto Trait Implementations§
impl<T> Freeze for WeightedReceiver<T>
impl<T> RefUnwindSafe for WeightedReceiver<T>
impl<T> Send for WeightedReceiver<T>
impl<T> Sync for WeightedReceiver<T>
impl<T> Unpin for WeightedReceiver<T>
impl<T> UnsafeUnpin for WeightedReceiver<T>
impl<T> UnwindSafe for WeightedReceiver<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