pub trait Read {
type Chunk: SplitByteSlice;
// Required methods
fn next_chunk(&mut self) -> ParseResult<Self::Chunk>;
fn chunks_len(&self) -> usize;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
An iterator over contiguous byte slices which can be parsed as a packet.
Required Associated Types§
Sourcetype Chunk: SplitByteSlice
type Chunk: SplitByteSlice
The type of each byte slice.
Required Methods§
Sourcefn next_chunk(&mut self) -> ParseResult<Self::Chunk>
fn next_chunk(&mut self) -> ParseResult<Self::Chunk>
Attempts to fetch the next available byte slice from self.
Sourcefn chunks_len(&self) -> usize
fn chunks_len(&self) -> usize
Returns the number of segments remaining.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<'a> Read for Iter<'a, Vec<u8>>
Available on crate feature alloc only.
impl<'a> Read for Iter<'a, Vec<u8>>
Available on crate feature
alloc only.type Chunk = &'a [u8]
fn next_chunk(&mut self) -> ParseResult<Self::Chunk>
fn chunks_len(&self) -> usize
Source§impl<'a> Read for IterMut<'a, Vec<u8>>
Available on crate feature alloc only.
impl<'a> Read for IterMut<'a, Vec<u8>>
Available on crate feature
alloc only.