Skip to main content

MemberPayload

Trait MemberPayload 

Source
pub trait MemberPayload: Sized {
    type Error;

    // Required methods
    async fn next_chunk(
        &mut self,
        buffer: &mut Vec<u8>,
        target_len: usize,
    ) -> Result<bool, Self::Error>;
    async fn skip(self) -> Result<(), Self::Error>;
}
Expand description

A streaming cursor over one archive member’s payload.

Required Associated Types§

Source

type Error

The archive-format error returned while reading the payload.

Required Methods§

Source

async fn next_chunk( &mut self, buffer: &mut Vec<u8>, target_len: usize, ) -> Result<bool, Self::Error>

Reads the next validated, logical payload chunk into a reusable buffer.

Returns true after replacing buffer with a nonempty chunk. Returns false only after the payload has been fully consumed and validated, leaving buffer unchanged so its initialized storage can be reused. Callers should not clear buffer between calls. Implementations may return chunks shorter than target_len.

Successful chunks contain decoded member contents rather than stored or compressed bytes. Their total length must equal the size declared by the enclosing Member; a mismatch must produce an error.

Source

async fn skip(self) -> Result<(), Self::Error>

Discards and validates all remaining payload bytes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§