[][src]Struct turbulence::packet_multiplexer::PacketMultiplexer

pub struct PacketMultiplexer<P> { /* fields omitted */ }

Routes packets marked with a channel header from a single Sink / Stream pair to a set of Sink / Stream pairs for each channel.

Also monitors bandwidth on each channel independently, and returns a ChannelStatistics handle to query bandwidth totals for that specific channel.

Implementations

impl<P> PacketMultiplexer<P> where
    P: Packet + Unpin
[src]

pub fn new() -> PacketMultiplexer<P>[src]

pub fn open_channel(
    &mut self,
    channel: PacketChannel,
    buffer_size: usize
) -> Result<(Sender<MuxPacket<P>>, Receiver<MuxPacket<P>>, ChannelStatistics), DuplicateChannel>
[src]

Open a multiplexed packet channel, producing a sender for outgoing MuxPackets on this channel, and a receiver for incoming MuxPackets on this channel.

The buffer_size parameter controls the buffer size requested when creating the MPSC futures channels for the returned Sender and Receiver.

pub fn start(
    self
) -> (IncomingMultiplexedPackets<P>, OutgoingMultiplexedPackets<P>)
[src]

Start multiplexing packets to all opened channels.

Returns an IncomingMultiplexedPackets which is a Sink for incoming packets, and an OutgoingMultiplexedPackets which is a Stream for outgoing packets.

Auto Trait Implementations

impl<P> !RefUnwindSafe for PacketMultiplexer<P>

impl<P> Send for PacketMultiplexer<P> where
    P: Send

impl<P> Sync for PacketMultiplexer<P> where
    P: Send

impl<P> Unpin for PacketMultiplexer<P>

impl<P> !UnwindSafe for PacketMultiplexer<P>

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.