[][src]Struct io_mux::Mux

pub struct Mux { /* fields omitted */ }

A Mux provides a single receive end and multiple send ends. Data sent to any of the send ends comes out the receive end, in order, tagged by the sender.

Methods

impl Mux[src]

pub fn new() -> Result<Self>[src]

Create a new Mux.

This will create a temporary directory for all the sockets managed by this Mux; dropping the Mux removes the temporary directory.

pub fn make_untagged_sender(&self) -> Result<MuxSender>[src]

Create a new MuxSender with no tag. Data sent via this MuxSender will arrive with a tag of None.

pub fn make_tagged_sender(&self, tag: &str) -> Result<MuxSender>[src]

Create a new MuxSender with the specified tag. Data sent via this MuxSender will arrive with a tag of Some(tag).

pub fn read<'mux>(&'mux mut self) -> Result<TaggedData<'mux>>[src]

Return the next chunk of data, together with its tag.

This reuses a buffer managed by the Mux.

Note that this provides no "EOF" indication; if no further data arrives, it will block forever. Avoid calling it after the source of the data exits.

Auto Trait Implementations

impl RefUnwindSafe for Mux

impl Send for Mux

impl Sync for Mux

impl Unpin for Mux

impl UnwindSafe for Mux

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, 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<V, T> VZip<V> for T where
    V: MultiLane<T>,