Struct async_unsync::bounded::Receiver
source · pub struct Receiver<T> { /* private fields */ }
Expand description
An owning handle for receiving elements through a split bounded Channel
.
Implementations§
source§impl<T> Receiver<T>
impl<T> Receiver<T>
sourcepub fn max_capacity(&self) -> usize
pub fn max_capacity(&self) -> usize
Returns the maximum buffer capacity of the channel.
This is the capacity initially specified when creating the channel and remains constant.
sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the current capacity of the channel.
The capacity goes down when sending a value and goes up when receiving a value. When the capacity is zero, any subsequent sends will only resolve once sufficient capacity is available
sourcepub fn try_recv(&mut self) -> Result<T, TryRecvError>
pub fn try_recv(&mut self) -> Result<T, TryRecvError>
Attempts to receive an element through the channel.
Errors
Fails, if the channel is empty or disconnected.