[][src]Struct constellation::Sender

pub struct Sender<T: Serialize>(_, _);

The sending half of a channel.

It has an async method send(value) and a nonblocking method try_send().

For blocking behaviour use .send(value).block().

Methods

impl<T: Serialize> Sender<T>[src]

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

Create a new Sender<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 Sender.

pub fn try_send<'a>(&'a self) -> Option<impl FnOnce(T) + 'a> where
    T: 'static, 
[src]

Nonblocking send.

If sending would not block, Some is returned with a FnOnce that accepts a T to send. If sending would block, None is returned.

pub async fn send<'_>(&'_ self, t: T) where
    T: 'static, 
[src]

Send

This is an async fn.

pub async fn send_with<'_>(&'_ self, f: impl FnOnce() -> T) where
    T: 'static, 
[src]

Send

This is an async fn.

Trait Implementations

impl<T: Serialize> Debug for Sender<T>[src]

impl<T: 'static + Serialize> Sink<T> for Sender<Option<T>>[src]

type Error = Infallible

The type of value produced by the sink when an error occurs.

impl<'a> Write for &'a Sender<u8>[src]

impl Write for Sender<u8>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Sender<T>

impl<T> Send for Sender<T>

impl<T> Sync for Sender<T>

impl<T> Unpin for Sender<T>

impl<T> UnwindSafe for Sender<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> Same<T> for T

type Output = T

Should always be Self

impl<T, Item> SinkExt<Item> for T where
    T: Sink<Item> + ?Sized
[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.

impl<T> Type for T[src]

type Meta = Concrete

Type of metadata for type.

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

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

impl<W> WriteBytesExt for W where
    W: Write + ?Sized