[][src]Struct constellation::Receiver

pub struct Receiver<T: DeserializeOwned>(_, _);

The receiving half of a channel.

It has an async method recv() and a nonblocking method try_recv().

For blocking behaviour use .recv().block().


impl<T: DeserializeOwned> Receiver<T>[src]

pub fn new(remote: Pid) -> Self[src]

Create a new Receiver<T> with a remote Pid. This method returns instantly.

pub fn remote_pid(&self) -> Pid[src]

Get the pid of the remote end of this Receiver.

pub fn try_recv<'a>(
    &'a self
) -> Option<impl FnOnce() -> Result<T, ChannelError> + 'a> where
    T: 'static, 

Nonblocking recv.

If receiving would not block, Some is returned with a FnOnce that returns a Result<T, ChannelError>. If receiving would block, None is returned.

pub async fn recv<'_>(&'_ self) -> Result<T, ChannelError> where
    T: 'static, 


This is an async fn.

Trait Implementations

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

impl<'a> Read for &'a Receiver<u8>[src]

impl Read for Receiver<u8>[src]

impl<T: 'static + DeserializeOwned> Stream for Receiver<Option<T>>[src]

type Item = Result<T, ChannelError>

Values yielded by the stream.

Auto Trait Implementations

impl<T> Send for Receiver<T>

impl<T> Unpin for Receiver<T>

impl<T> Sync for Receiver<T>

impl<T> UnwindSafe for Receiver<T>

impl<T> RefUnwindSafe for Receiver<T>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

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

impl<R> ReadBytesExt for R where
    R: Read + ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<T> StreamExt for T where
    T: Stream + ?Sized

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized