[−][src]Struct flume::Receiver
The receiving end of a channel.
Implementations
impl<T> Receiver<T>
[src]
pub fn recv_async(&self) -> impl Future<Output = Result<T, RecvError>> + '_
[src]
Asynchronously wait for an incoming value from the channel associated with this receiver, returning an error if all channel senders have been dropped.
pub fn stream(&self) -> impl Stream<Item = T> + '_
[src]
Use this channel as an asynchronous stream of items.
impl<T> Receiver<T>
[src]
pub fn try_recv(&self) -> Result<T, TryRecvError>
[src]
Attempt to fetch an incoming value from the channel associated with this receiver, returning an error if the channel is empty or all channel senders have been dropped.
pub fn recv(&self) -> Result<T, RecvError>
[src]
Wait for an incoming value from the channel associated with this receiver, returning an error if all channel senders have been dropped.
pub fn recv_deadline(&self, deadline: Instant) -> Result<T, RecvTimeoutError>
[src]
Wait for an incoming value from the channel associated with this receiver, returning an error if all channel senders have been dropped or the deadline has passed.
pub fn recv_timeout(&self, dur: Duration) -> Result<T, RecvTimeoutError>
[src]
Wait for an incoming value from the channel associated with this receiver, returning an error if all channel senders have been dropped or the timeout has expired.
pub fn iter(&self) -> Iter<'_, T>ⓘ
[src]
A blocking iterator over the values received on the channel that finishes iteration when all receivers of the channel have been dropped.
pub fn try_iter(&self) -> TryIter<'_, T>ⓘ
[src]
A non-blocking iterator over the values received on the channel that finishes iteration when all receivers of the channel have been dropped or the channel is empty.
pub fn drain(&self) -> Drain<'_, T>ⓘ
[src]
Take all msgs currently sitting in the channel and produce an iterator over them. Unlike
try_iter
, the iterator will not attempt to fetch any more values from the channel once
the function has been called.
pub fn is_disconnected(&self) -> bool
[src]
Returns true if all senders for this channel have been dropped.
pub fn is_empty(&self) -> bool
[src]
Returns true if the channel is empty. Note: Zero-capacity channels are always empty.
pub fn is_full(&self) -> bool
[src]
Returns true if the channel is full. Note: Zero-capacity channels are always full.
pub fn len(&self) -> usize
[src]
Returns the number of messages in the channel.
pub fn capacity(&self) -> Option<usize>
[src]
If the channel is bounded, returns its capacity.
Trait Implementations
impl<T> Clone for Receiver<T>
[src]
fn clone(&self) -> Self
[src]
Clone this receiver. Receiver
acts as a handle to the ending a channel. Remaining
channel contents will only be cleaned up when all senders and the receiver have been
dropped.
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Debug for Receiver<T>
[src]
impl<T> Drop for Receiver<T>
[src]
impl<'a, T> IntoIterator for &'a Receiver<T>
[src]
type Item = T
The type of the elements being iterated over.
type IntoIter = Iter<'a, T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<T> IntoIterator for Receiver<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Receiver<T>
impl<T> Send for Receiver<T> where
T: Send,
T: Send,
impl<T> Sync for Receiver<T> where
T: Send,
T: Send,
impl<T> Unpin for Receiver<T>
impl<T> !UnwindSafe for Receiver<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,