Trait lepton_mux::StreamDemuxer [−][src]
pub trait StreamDemuxer<AllocU8: Allocator<u8>> { fn deserialize(&mut self, data: &[u8], alloc_u8: &mut AllocU8) -> usize; fn read_buffer(&mut self, stream_id: StreamID) -> ReadableBytes; fn data_len(&self, stream_id: StreamID) -> usize; fn data(&self, stream_id: StreamID) -> &[u8]; fn editable_data(
&mut self,
stream_id: StreamID
) -> &mut AllocatedMemoryRange<u8, AllocU8>; fn consume_data(&mut self, stream_id: StreamID, count: usize); fn consumed_all_streams_until_eof(&self) -> bool; fn encountered_eof(&self) -> bool; fn free(&mut self, alloc_u8: &mut AllocU8); fn n_stream(&self) -> usize; }
Required Methods
fn deserialize(&mut self, data: &[u8], alloc_u8: &mut AllocU8) -> usize
Demultiplexes data
into streams.
fn read_buffer(&mut self, stream_id: StreamID) -> ReadableBytes
Returns an array of n_stream
ReadableByte
s. Each ReadableByte is connected to
the buffer of its corresponding stream.
fn data_len(&self, stream_id: StreamID) -> usize
fn data(&self, stream_id: StreamID) -> &[u8]
fn editable_data(
&mut self,
stream_id: StreamID
) -> &mut AllocatedMemoryRange<u8, AllocU8>
&mut self,
stream_id: StreamID
) -> &mut AllocatedMemoryRange<u8, AllocU8>