Struct crusty_core::prelude::ChReceiver [−][src]
pub struct ChReceiver<T> { /* fields omitted */ }
Expand description
The receiving end of a channel.
Note: Cloning the receiver does not turn this channel into a broadcast channel. Each message will only be received by a single receiver. This is useful for implementing work stealing for concurrent programs.
Implementations
impl<T> Receiver<T>
[src]
impl<T> Receiver<T>
[src]pub fn recv_async(&self) -> RecvFut<'_, T>ⓘ
[src]
pub fn recv_async(&self) -> RecvFut<'_, T>ⓘ
[src]Asynchronously receive a value from the channel, returning an error if all senders have been dropped. If the channel is empty, the returned future will yield to the async runtime.
pub fn into_recv_async(self) -> RecvFut<'static, T>ⓘ
[src]
pub fn into_recv_async(self) -> RecvFut<'static, T>ⓘ
[src]Convert this receiver into a future that asynchronously receives a single message from the channel, returning an error if all senders have been dropped. If the channel is empty, this future will yield to the async runtime.
pub fn stream(&self) -> RecvStream<'_, T>
[src]
pub fn stream(&self) -> RecvStream<'_, T>
[src]Create an asynchronous stream that uses this receiver to asynchronously receive messages from the channel. The receiver will continue to be usable after the stream has been dropped.
pub fn into_stream(self) -> RecvStream<'static, T>
[src]
pub fn into_stream(self) -> RecvStream<'static, T>
[src]Convert this receiver into a stream that allows asynchronously receiving messages from the channel.
impl<T> Receiver<T>
[src]
impl<T> Receiver<T>
[src]pub fn try_recv(&self) -> Result<T, TryRecvError>
[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.
pub fn recv(&self) -> Result<T, RecvError>
[src]
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 senders have been dropped.
pub fn recv_deadline(&self, deadline: Instant) -> Result<T, RecvTimeoutError>
[src]
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 senders have been dropped or the deadline has passed.
pub fn recv_timeout(&self, dur: Duration) -> Result<T, RecvTimeoutError>
[src]
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 senders have been dropped or the timeout has expired.
pub fn iter(&self) -> Iter<'_, T>
[src]
pub fn iter(&self) -> Iter<'_, T>
[src]Create a blocking iterator over the values received on the channel that finishes iteration when all senders have been dropped.
pub fn try_iter(&self) -> TryIter<'_, T>
[src]
pub fn try_iter(&self) -> TryIter<'_, T>
[src]A non-blocking iterator over the values received on the channel that finishes iteration when all senders have been dropped or the channel is empty.
pub fn drain(&self) -> Drain<'_, T>
[src]
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]
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]
pub fn is_empty(&self) -> bool
[src]Returns true if the channel is empty. Note: Zero-capacity channels are always empty.
Trait Implementations
impl<T> Clone for Receiver<T>
[src]
impl<T> Clone for Receiver<T>
[src]pub fn clone(&self) -> Receiver<T>
[src]
pub fn clone(&self) -> Receiver<T>
[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.
Note: Cloning the receiver does not turn this channel into a broadcast channel. Each message will only be received by a single receiver. This is useful for implementing work stealing for concurrent programs.
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl<'a, T> IntoIterator for &'a Receiver<T>
[src]
impl<'a, T> IntoIterator for &'a 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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
impl<T> WithSubscriber for T
[src]fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
[src]Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
[src]
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
[src]Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
impl<T> JobStateValues for T where
T: 'static + Send + Sync + Clone,
[src]
T: 'static + Send + Sync + Clone,