Struct futures_channel::oneshot::Receiver [−][src]
#[must_use = "futures do nothing unless polled"]pub struct Receiver<T> { /* fields omitted */ }
A future for a value that will be provided by another asynchronous task.
This is created by the channel
function.
Methods
impl<T> Receiver<T>
[src]
impl<T> Receiver<T>
pub fn close(&mut self)
[src]
pub fn close(&mut self)
Gracefully close this receiver, preventing any subsequent attempts to send to it.
Any send
operation which happens after this method returns is
guaranteed to fail. After calling this method, you can use
Receiver::poll
to determine whether a
message had previously been sent.
pub fn try_recv(&mut self) -> Result<Option<T>, Canceled>
[src]
pub fn try_recv(&mut self) -> Result<Option<T>, Canceled>
Attempts to receive a message outside of the context of a task.
Useful when a Context
is not available
such as within a Drop
impl.
Does not schedule a task wakeup or have any other side effects.
A return value of None
must be considered immediately stale (out of
date) unless close
has been called first.
Returns an error if the sender was dropped.
Trait Implementations
impl<T: Debug> Debug for Receiver<T>
[src]
impl<T: Debug> Debug for Receiver<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T> Unpin for Receiver<T>
[src]
impl<T> Unpin for Receiver<T>
impl<T> Future for Receiver<T>
[src]
impl<T> Future for Receiver<T>
type Output = Result<T, Canceled>
🔬 This is a nightly-only experimental API. (futures_api
)
futures in libcore are unstable
The result of the Future
.
fn poll(self: PinMut<Self>, cx: &mut Context) -> Poll<Result<T, Canceled>>
[src]
fn poll(self: PinMut<Self>, cx: &mut Context) -> Poll<Result<T, Canceled>>
🔬 This is a nightly-only experimental API. (futures_api
)
futures in libcore are unstable
Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more
impl<T> Drop for Receiver<T>
[src]
impl<T> Drop for Receiver<T>