[−][src]Struct io_mux::Mux
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,