pub struct MemberPayload<'a, R> { /* private fields */ }Expand description
A streaming, typed cursor over one member’s payload blocks.
Implementations§
Source§impl<R: AsyncRead + Unpin> MemberPayload<'_, R>
impl<R: AsyncRead + Unpin> MemberPayload<'_, R>
Sourcepub async fn next_block(&mut self) -> Result<Option<PayloadBlock>, FrameError>
pub async fn next_block(&mut self) -> Result<Option<PayloadBlock>, FrameError>
Returns the next meaningful payload block, excluding final padding in len.
Sourcepub async fn next_chunk(
&mut self,
buffer: &mut Vec<u8>,
target_len: usize,
) -> Result<bool, FrameError>
pub async fn next_chunk( &mut self, buffer: &mut Vec<u8>, target_len: usize, ) -> Result<bool, FrameError>
Reads validated payload bytes into a reusable chunk buffer.
When this returns true, the buffer’s existing contents are replaced.
When the payload is exhausted, it returns false without changing the
buffer so its initialized storage can be reused. Complete physical blocks
are read directly into it until the chunk contains at least target_len
bytes or the payload ends. The target is raised to one physical block
when it is smaller, and final-block padding is removed before this
returns. This preserves Self::next_block as the lossless interface
while allowing higher-level consumers to amortize per-block bookkeeping
and copies.
Sourcepub async fn skip(self) -> Result<(), FrameError>
pub async fn skip(self) -> Result<(), FrameError>
Discards and validates all remaining payload bytes using reusable storage.