Struct lepton_mux::Mux [−][src]
Methods
impl<AllocU8: Allocator<u8>> Mux<AllocU8>
[src]
impl<AllocU8: Allocator<u8>> Mux<AllocU8>
pub fn new(n_stream: usize) -> Self
[src]
pub fn new(n_stream: usize) -> Self
pub fn n_stream(&self) -> usize
[src]
pub fn n_stream(&self) -> usize
pub fn read_cursor(&self, index: usize) -> usize
[src]
pub fn read_cursor(&self, index: usize) -> usize
pub fn write_cursor(&self, index: usize) -> usize
[src]
pub fn write_cursor(&self, index: usize) -> usize
pub fn is_eof(&self) -> bool
[src]
pub fn is_eof(&self) -> bool
pub fn prealloc(&mut self, alloc_u8: &mut AllocU8, amount_per_stream: usize)
[src]
pub fn prealloc(&mut self, alloc_u8: &mut AllocU8, amount_per_stream: usize)
pub fn free(&mut self, alloc_u8: &mut AllocU8)
[src]
pub fn free(&mut self, alloc_u8: &mut AllocU8)
pub fn push_data(
&mut self,
stream_id: StreamID,
data: &[u8],
alloc_u8: &mut AllocU8
)
[src]
pub fn push_data(
&mut self,
stream_id: StreamID,
data: &[u8],
alloc_u8: &mut AllocU8
)
Pushes data from a source into the stream buffer specified by stream_id
.
This data may later be serialized through serialize
or else consumed
through data
or consume
.
Trait Implementations
impl<AllocU8: Allocator<u8>> Default for Mux<AllocU8>
[src]
impl<AllocU8: Allocator<u8>> Default for Mux<AllocU8>
impl<AllocU8: Allocator<u8>> StreamMuxer<AllocU8> for Mux<AllocU8>
[src]
impl<AllocU8: Allocator<u8>> StreamMuxer<AllocU8> for Mux<AllocU8>
fn write(
&mut self,
stream_id: StreamID,
data: &[u8],
alloc_u8: &mut AllocU8
) -> usize
[src]
fn write(
&mut self,
stream_id: StreamID,
data: &[u8],
alloc_u8: &mut AllocU8
) -> usize
Writes data
to the specified stream.
fn write_buffer(
&mut self,
stream_id: StreamID,
alloc_u8: &mut AllocU8
) -> WritableBytes
[src]
fn write_buffer(
&mut self,
stream_id: StreamID,
alloc_u8: &mut AllocU8
) -> WritableBytes
Returns an array of n_stream
WritableByte
s. Each WritableByte is connected to the buffer of its corresponding stream. Read more
fn serialize(&mut self, output: &mut [u8]) -> usize
[src]
fn serialize(&mut self, output: &mut [u8]) -> usize
Populate output
with content buffered by each stream in a "fair" manner.
fn flush(&mut self, output: &mut [u8]) -> usize
[src]
fn flush(&mut self, output: &mut [u8]) -> usize
fn wrote_eof(&self) -> bool
[src]
fn wrote_eof(&self) -> bool
fn free(&mut self, alloc_u8: &mut AllocU8)
[src]
fn free(&mut self, alloc_u8: &mut AllocU8)
fn n_stream(&self) -> usize
[src]
fn n_stream(&self) -> usize
fn can_serialize() -> bool
[src]
fn can_serialize() -> bool
impl<AllocU8: Allocator<u8>> StreamDemuxer<AllocU8> for Mux<AllocU8>
[src]
impl<AllocU8: Allocator<u8>> StreamDemuxer<AllocU8> for Mux<AllocU8>
fn deserialize(&mut self, data: &[u8], alloc_u8: &mut AllocU8) -> usize
[src]
fn deserialize(&mut self, data: &[u8], alloc_u8: &mut AllocU8) -> usize
Demultiplexes data
into streams.
fn read_buffer(&mut self, stream_id: StreamID) -> ReadableBytes
[src]
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. Read more
fn data_len(&self, stream_id: StreamID) -> usize
[src]
fn data_len(&self, stream_id: StreamID) -> usize
fn data(&self, stream_id: StreamID) -> &[u8]
[src]
fn data(&self, stream_id: StreamID) -> &[u8]
fn editable_data(
&mut self,
stream_id: StreamID
) -> &mut AllocatedMemoryRange<u8, AllocU8>
[src]
fn editable_data(
&mut self,
stream_id: StreamID
) -> &mut AllocatedMemoryRange<u8, AllocU8>
fn consume_data(&mut self, stream_id: StreamID, count: usize)
[src]
fn consume_data(&mut self, stream_id: StreamID, count: usize)
fn consumed_all_streams_until_eof(&self) -> bool
[src]
fn consumed_all_streams_until_eof(&self) -> bool
fn encountered_eof(&self) -> bool
[src]
fn encountered_eof(&self) -> bool
fn free(&mut self, alloc_u8: &mut AllocU8)
[src]
fn free(&mut self, alloc_u8: &mut AllocU8)
fn n_stream(&self) -> usize
[src]
fn n_stream(&self) -> usize