[−][src]Struct turbulence::packet_multiplexer::PacketMultiplexer
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]
P: Packet + Unpin,
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]
&mut self,
channel: PacketChannel,
buffer_size: usize
) -> Result<(Sender<MuxPacket<P>>, Receiver<MuxPacket<P>>, ChannelStatistics), DuplicateChannel>
Open a multiplexed packet channel, producing a sender for outgoing MuxPacket
s on this
channel, and a receiver for incoming MuxPacket
s 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]
self
) -> (IncomingMultiplexedPackets<P>, OutgoingMultiplexedPackets<P>)
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,
P: Send,
impl<P> Sync for PacketMultiplexer<P> where
P: Send,
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]
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,
pub 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.
pub 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>,