Struct heph_inbox::Receiver[][src]

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

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]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

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

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.