pub trait ContentReader {
// Required method
fn read_chunk(
&self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, ContentError>> + '_>>;
}Expand description
A pull reader over one piece of content.
Each read_chunk resolves to the next chunk of
bytes, or None once the content is exhausted. Chunk sizes are chosen by the
provider; framework readers use DEFAULT_CHUNK_LEN.
Required Methods§
Sourcefn read_chunk(
&self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, ContentError>> + '_>>
fn read_chunk( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, ContentError>> + '_>>
Resolves to the next chunk, or None at end of content.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".