Struct lunatic::channel::Receiver[][src]

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

The receiving side of a channel.

Receivers can be cloned and shared among processes. When all receivers associated with a channel are dropped, the channel becomes closed.

Implementations

impl<T> Receiver<T> where
    T: Serialize + DeserializeOwned
[src]

pub fn receive(&self) -> Result<T, ()>[src]

Receives a message from the channel.

If the channel is empty, this method waits until there is a message.

If the channel is closed, this method receives a message or returns an error if there are no more messages.

Trait Implementations

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

impl<'de, T> Deserialize<'de> for Receiver<T> where
    T: Serialize + DeserializeOwned
[src]

impl<T> Serialize for Receiver<T> where
    T: Serialize + DeserializeOwned
[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Receiver<T>[src]

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

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

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

impl<T> UnwindSafe for Receiver<T> where
    T: UnwindSafe
[src]

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.