Skip to main content

MemberPayload

Struct MemberPayload 

Source
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>

Source

pub async fn next_block(&mut self) -> Result<Option<PayloadBlock>, FrameError>

Returns the next meaningful payload block, excluding final padding in len.

Source

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.

Source

pub async fn skip(self) -> Result<(), FrameError>

Discards and validates all remaining payload bytes using reusable storage.

Auto Trait Implementations§

§

impl<'a, R> !UnwindSafe for MemberPayload<'a, R>

§

impl<'a, R> Freeze for MemberPayload<'a, R>

§

impl<'a, R> RefUnwindSafe for MemberPayload<'a, R>
where R: RefUnwindSafe,

§

impl<'a, R> Send for MemberPayload<'a, R>
where R: Send,

§

impl<'a, R> Sync for MemberPayload<'a, R>
where R: Sync,

§

impl<'a, R> Unpin for MemberPayload<'a, R>

§

impl<'a, R> UnsafeUnpin for MemberPayload<'a, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.