Struct heph_inbox::oneshot::Receiver[][src]

pub struct Receiver<T> { /* fields omitted */ }

The receiving half of the one-shot channel.

This half can only be owned and used by one thread.

Implementations

impl<T> Receiver<T>[src]

pub fn try_recv(&mut self) -> Result<(T, Sender<T>), RecvError>[src]

Attempts to receive a value and reset the channel.

If it succeeds it returns the value and resets the channel, returning a new Sender (which can send a value to this Receiver).

pub fn recv<'r>(&'r mut self) -> RecvValue<'r, T>

Notable traits for RecvValue<'r, T>

impl<'r, T> Future for RecvValue<'r, T> type Output = Option<(T, Sender<T>)>;
[src]

Returns a future that receives a value from the channel, waiting if the channel is empty.

If the returned Future returns None it means the Sender is disconnected without sending a value. This is the same error as RecvError::Disconnected. RecvError::NoValue will never be returned, the Future will return Poll::Pending instead.

pub fn recv_once(self) -> RecvOnce<T>

Notable traits for RecvOnce<T>

impl<T> Future for RecvOnce<T> type Output = Option<T>;
[src]

Returns an owned version of Receiver::recv that can only be used once.

See Receiver::recv for more information.

pub fn try_reset(&mut self) -> Option<Sender<T>>[src]

Attempt to reset the channel.

If the sender is disconnected this will return a new Sender. If the sender is still connected this will return None.

Notes

If the channel contains a value it will be dropped.

pub fn is_connected(&self) -> bool[src]

Returns true if the Sender is connected.

Trait Implementations

impl<T> Debug for Receiver<T>[src]

impl<T> Drop for Receiver<T>[src]

impl<T: Send> Send for Receiver<T>[src]

impl<T: Send> Sync for Receiver<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Receiver<T>

impl<T> Unpin for Receiver<T>

impl<T> !UnwindSafe for Receiver<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.