pub struct Receiver<C, T>where
C: Controller<Item = T>,{ /* private fields */ }Expand description
Channel receiver end-point.
Implementations§
Source§impl<C, T> Receiver<C, T>where
C: Controller<Item = T>,
impl<C, T> Receiver<C, T>where
C: Controller<Item = T>,
Sourcepub fn ctrl(&self) -> Ctrl<C, T>
pub fn ctrl(&self) -> Ctrl<C, T>
Return a Ctrl, which can be used to access the internal
Controller.
Sourcepub fn recv_blocking(&self) -> Result<T, Error<T>>
pub fn recv_blocking(&self) -> Result<T, Error<T>>
Receive a node from queue. If the queue is empty, block and wait for a new node to arrive.
§Errors
Error::Closed means that the queue is empty and all the
Senders have been dropped.
Sourcepub fn recv_async(&self) -> RecvFuture<C, T> ⓘ
pub fn recv_async(&self) -> RecvFuture<C, T> ⓘ
Returns a Future that is the async equivalent of
Receiver::recv_blocking().
Sourcepub fn try_recv(&self) -> Result<Option<T>, Error<T>>
pub fn try_recv(&self) -> Result<Option<T>, Error<T>>
Attempt to retreive a node from the queue.
Returns Ok(Some(T)) if there’s a node available for immediate pickup.
Returns Ok(None) is there are no nodes to pick up.
§Errors
Error::Closed means that the queue is empty and all the
Senders have been dropped.
Trait Implementations§
Source§impl<C, T> Clone for Receiver<C, T>where
C: Controller<Item = T>,
impl<C, T> Clone for Receiver<C, T>where
C: Controller<Item = T>,
Auto Trait Implementations§
impl<C, T> Freeze for Receiver<C, T>
impl<C, T> !RefUnwindSafe for Receiver<C, T>
impl<C, T> Send for Receiver<C, T>
impl<C, T> Sync for Receiver<C, T>
impl<C, T> Unpin for Receiver<C, T>
impl<C, T> !UnwindSafe for Receiver<C, 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