pub struct Receiver<T> { /* private fields */ }
Expand description
The receiver half of a oneshot channel. Can recieve a single message (or none if the sender drops) with the postage::Stream trait.
Trait Implementations
sourceimpl<T> Stream for Receiver<T>
impl<T> Stream for Receiver<T>
type Item = T
sourcefn poll_recv(self: Pin<&mut Self>, cx: &mut Context<'_>) -> PollRecv<Self::Item>
fn poll_recv(self: Pin<&mut Self>, cx: &mut Context<'_>) -> PollRecv<Self::Item>
Attempts to retrieve an item from the stream, without blocking. Read more
sourcefn recv(&mut self) -> RecvFuture<'_, Self>ⓘNotable traits for RecvFuture<'s, S>impl<'s, S> Future for RecvFuture<'s, S> where
S: Stream + Unpin + ?Sized, type Output = Option<S::Item>;
where
Self: Unpin,
fn recv(&mut self) -> RecvFuture<'_, Self>ⓘNotable traits for RecvFuture<'s, S>impl<'s, S> Future for RecvFuture<'s, S> where
S: Stream + Unpin + ?Sized, type Output = Option<S::Item>;
where
Self: Unpin,
S: Stream + Unpin + ?Sized, type Output = Option<S::Item>;
Retrieves a message from the stream. Read more
sourcefn try_recv(&mut self) -> Result<Self::Item, TryRecvError> where
Self: Unpin,
fn try_recv(&mut self) -> Result<Self::Item, TryRecvError> where
Self: Unpin,
Attempts to retrive a message from the stream, without blocking. Read more
sourcefn blocking_recv(&mut self) -> Option<Self::Item> where
Self: Unpin,
fn blocking_recv(&mut self) -> Option<Self::Item> where
Self: Unpin,
Retrieves a message from the stream, blocking the current thread until one is available. Read more
sourcefn map<Map, Into>(self, map: Map) -> MapStream<Self, Map, Into> where
Map: Fn(Self::Item) -> Into,
Self: Sized,
fn map<Map, Into>(self, map: Map) -> MapStream<Self, Map, Into> where
Map: Fn(Self::Item) -> Into,
Self: Sized,
Transforms the stream with a map function.
sourcefn filter<Filter>(self, filter: Filter) -> FilterStream<Self, Filter> where
Self: Sized + Unpin,
Filter: FnMut(&Self::Item) -> bool + Unpin,
fn filter<Filter>(self, filter: Filter) -> FilterStream<Self, Filter> where
Self: Sized + Unpin,
Filter: FnMut(&Self::Item) -> bool + Unpin,
Filters messages returned by the stream, ignoring messages where filter
returns false.
sourcefn merge<Other>(self, other: Other) -> MergeStream<Self, Other> where
Other: Stream<Item = Self::Item>,
Self: Sized,
fn merge<Other>(self, other: Other) -> MergeStream<Self, Other> where
Other: Stream<Item = Self::Item>,
Self: Sized,
Merges two streams, returning values from both at once, until both are closed.
sourcefn chain<Other>(self, other: Other) -> ChainStream<Self, Other> where
Other: Stream<Item = Self::Item>,
Self: Sized,
fn chain<Other>(self, other: Other) -> ChainStream<Self, Other> where
Other: Stream<Item = Self::Item>,
Self: Sized,
Chains two streams, returning values from self
until it is closed, and then returning values from other
.
Auto Trait Implementations
impl<T> !RefUnwindSafe for Receiver<T>
impl<T> Send for Receiver<T> where
T: Send,
impl<T> Sync for Receiver<T> where
T: Send,
impl<T> Unpin for Receiver<T>
impl<T> !UnwindSafe for Receiver<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more