pub struct ChunkReader { /* private fields */ }
Expand description
A chunk reader.
This is used to read chunks from a stream.
Implementations§
Source§impl ChunkReader
impl ChunkReader
Sourcepub fn update_max_chunk_size(&mut self, chunk_size: usize) -> bool
pub fn update_max_chunk_size(&mut self, chunk_size: usize) -> bool
Call when a client requests a chunk size change.
Returns false
if the chunk size is out of bounds.
The connection should be closed in this case.
Sourcepub fn read_chunk(
&mut self,
buffer: &mut BytesMut,
) -> Result<Option<Chunk>, RtmpError>
pub fn read_chunk( &mut self, buffer: &mut BytesMut, ) -> Result<Option<Chunk>, RtmpError>
This function is used to read a chunk from the buffer.
Returns:
Ok(None)
if the buffer does not contain enough data to read a full chunk.Ok(Some(Chunk))
if a full chunk is read.Err(ChunkReadError)
if there is an error decoding a chunk. The connection should be closed.
§See also
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChunkReader
impl RefUnwindSafe for ChunkReader
impl Send for ChunkReader
impl Sync for ChunkReader
impl Unpin for ChunkReader
impl UnwindSafe for ChunkReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more