Struct heph_inbox::Receiver[][src]

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

Receiving side of the channel.

Implementations

impl<T> Receiver<T>[src]

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

Attempts to receive a value from this channel.

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>;
[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 all Senders are disconnected. This is the same error as RecvError::Disconnected. RecvError::Empty will never be returned, the Future will return Poll::Pending instead.

pub fn new_sender(&self) -> Sender<T>[src]

Create a new Sender that sends to this channel.

Safety

The same restrictions apply to this function as they do to Sender::clone.

pub fn capacity(&self) -> usize[src]

Returns the capacity of the channel.

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

Returns false if all Senders are disconnected.

Notes

Unlike Sender::is_connected this method doesn’t take the Manager into account. This means that this method can return false and later true (if the Manager created another Sender), which might be unexpected.

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

Returns true if the Manager is connected.

pub fn register_waker(&mut self, waker: &Waker) -> bool[src]

Set the receiver’s waker to waker, if they are different. Returns true if the waker is changed, false otherwise.

This is useful if you can’t call Receiver::recv but still want a wake-up notification once messages are added to the inbox.

pub fn id(&self) -> Id[src]

Returns the id of this receiver.

Trait Implementations

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

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

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

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

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

Auto Trait Implementations

impl<T> !RefUnwindSafe 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.