[][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<'a> Write for &'a Sender<u8>[src]

fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize, Error>1.36.0[src]

Like write, except that it writes from a slice of buffers. Read more

fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>1.0.0[src]

Writes a formatted string into this writer, returning any error encountered. Read more

fn by_ref(&mut self) -> &mut Self1.0.0[src]

Creates a "by reference" adaptor for this instance of Write. Read more

impl Write for Sender<u8>[src]

fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize, Error>1.36.0[src]

Like write, except that it writes from a slice of buffers. Read more

fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>1.0.0[src]

Writes a formatted string into this writer, returning any error encountered. Read more

fn by_ref(&mut self) -> &mut Self1.0.0[src]

Creates a "by reference" adaptor for this instance of Write. Read more

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.

Auto Trait Implementations

impl<T> Sync for Sender<T>

impl<T> Send for Sender<T>

impl<T> Unpin for Sender<T>

impl<T> RefUnwindSafe for Sender<T>

impl<T> UnwindSafe for Sender<T>

Blanket Implementations

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.

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

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

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

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

fn write_u8(&mut self, n: u8) -> Result<(), Error>

Writes an unsigned 8 bit integer to the underlying writer. Read more

fn write_i8(&mut self, n: i8) -> Result<(), Error>

Writes a signed 8 bit integer to the underlying writer. Read more

fn write_u16<T>(&mut self, n: u16) -> Result<(), Error> where
    T: ByteOrder, 

Writes an unsigned 16 bit integer to the underlying writer. Read more

fn write_i16<T>(&mut self, n: i16) -> Result<(), Error> where
    T: ByteOrder, 

Writes a signed 16 bit integer to the underlying writer. Read more

fn write_u24<T>(&mut self, n: u32) -> Result<(), Error> where
    T: ByteOrder, 

Writes an unsigned 24 bit integer to the underlying writer. Read more

fn write_i24<T>(&mut self, n: i32) -> Result<(), Error> where
    T: ByteOrder, 

Writes a signed 24 bit integer to the underlying writer. Read more

fn write_u32<T>(&mut self, n: u32) -> Result<(), Error> where
    T: ByteOrder, 

Writes an unsigned 32 bit integer to the underlying writer. Read more

fn write_i32<T>(&mut self, n: i32) -> Result<(), Error> where
    T: ByteOrder, 

Writes a signed 32 bit integer to the underlying writer. Read more

fn write_u48<T>(&mut self, n: u64) -> Result<(), Error> where
    T: ByteOrder, 

Writes an unsigned 48 bit integer to the underlying writer. Read more

fn write_i48<T>(&mut self, n: i64) -> Result<(), Error> where
    T: ByteOrder, 

Writes a signed 48 bit integer to the underlying writer. Read more

fn write_u64<T>(&mut self, n: u64) -> Result<(), Error> where
    T: ByteOrder, 

Writes an unsigned 64 bit integer to the underlying writer. Read more

fn write_i64<T>(&mut self, n: i64) -> Result<(), Error> where
    T: ByteOrder, 

Writes a signed 64 bit integer to the underlying writer. Read more

fn write_u128<T>(&mut self, n: u128) -> Result<(), Error> where
    T: ByteOrder, 

Writes an unsigned 128 bit integer to the underlying writer.

fn write_i128<T>(&mut self, n: i128) -> Result<(), Error> where
    T: ByteOrder, 

Writes a signed 128 bit integer to the underlying writer.

fn write_uint<T>(&mut self, n: u64, nbytes: usize) -> Result<(), Error> where
    T: ByteOrder, 

Writes an unsigned n-bytes integer to the underlying writer. Read more

fn write_int<T>(&mut self, n: i64, nbytes: usize) -> Result<(), Error> where
    T: ByteOrder, 

Writes a signed n-bytes integer to the underlying writer. Read more

fn write_uint128<T>(&mut self, n: u128, nbytes: usize) -> Result<(), Error> where
    T: ByteOrder, 

Writes an unsigned n-bytes integer to the underlying writer. Read more

fn write_int128<T>(&mut self, n: i128, nbytes: usize) -> Result<(), Error> where
    T: ByteOrder, 

Writes a signed n-bytes integer to the underlying writer. Read more

fn write_f32<T>(&mut self, n: f32) -> Result<(), Error> where
    T: ByteOrder, 

Writes a IEEE754 single-precision (4 bytes) floating point number to the underlying writer. Read more

fn write_f64<T>(&mut self, n: f64) -> Result<(), Error> where
    T: ByteOrder, 

Writes a IEEE754 double-precision (8 bytes) floating point number to the underlying writer. Read more

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

impl<T, Item> SinkExt<Item> for T where
    T: Sink<Item> + ?Sized
[src]

fn with<U, Fut, F, E>(self, f: F) -> With<Self, Item, U, Fut, F> where
    E: From<Self::Error>,
    F: FnMut(U) -> Fut,
    Fut: Future<Output = Result<Item, E>>, 
[src]

Composes a function in front of the sink. Read more

fn with_flat_map<U, St, F>(self, f: F) -> WithFlatMap<Self, Item, U, St, F> where
    F: FnMut(U) -> St,
    St: Stream<Item = Result<Item, Self::Error>>, 
[src]

Composes a function in front of the sink. Read more

fn sink_map_err<E, F>(self, f: F) -> SinkMapErr<Self, F> where
    F: FnOnce(Self::Error) -> E, 
[src]

Transforms the error returned by the sink.

fn sink_err_into<E>(self) -> SinkErrInto<Self, Item, E> where
    Self::Error: Into<E>, 
[src]

Map this sink's error to a different error type using the Into trait. Read more

fn buffer(self, capacity: usize) -> Buffer<Self, Item>[src]

Adds a fixed-size buffer to the current sink. Read more

fn close(&mut self) -> Close<Self, Item> where
    Self: Unpin
[src]

Close the sink.

fn fanout<Si>(self, other: Si) -> Fanout<Self, Si> where
    Item: Clone,
    Si: Sink<Item, Error = Self::Error>, 
[src]

Fanout items to multiple sinks. Read more

fn flush(&mut self) -> Flush<Self, Item> where
    Self: Unpin
[src]

Flush the sync, processing all pending items. Read more

fn send(&mut self, item: Item) -> Send<Self, Item> where
    Self: Unpin
[src]

A future that completes after the given item has been fully processed into the sink, including flushing. Read more

fn send_all<St>(&'a mut self, stream: &'a mut St) -> SendAll<'a, Self, St> where
    Self: Unpin,
    St: Stream<Item = Item> + Unpin
[src]

A future that completes after the given stream has been fully processed into the sink, including flushing. Read more

fn left_sink<Si2>(self) -> Either<Self, Si2> where
    Si2: Sink<Item, Error = Self::Error>, 
[src]

Wrap this sink in an Either sink, making it the left-hand variant of that Either. Read more

fn right_sink<Si1>(self) -> Either<Si1, Self> where
    Si1: Sink<Item, Error = Self::Error>, 
[src]

Wrap this stream in an Either stream, making it the right-hand variant of that Either. Read more