Trait xwt_core::stream::ReadChunk

source ·
pub trait ReadChunk<ChunkType: ?Sized + ReadableChunk>: Send {
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn read_chunk(
        &mut self,
        max_length: usize,
        ordered: bool
    ) -> impl Future<Output = Result<Option<Chunk<<ChunkType as ReadableChunk>::Data<'_>>>, Self::Error>> + Send;
}
Expand description

Read a Chunk from a stream.

Required Associated Types§

source

type Error: Error + Send + Sync + 'static

An error that can occur while reading a chunk from the stream.

Required Methods§

source

fn read_chunk( &mut self, max_length: usize, ordered: bool ) -> impl Future<Output = Result<Option<Chunk<<ChunkType as ReadableChunk>::Data<'_>>>, Self::Error>> + Send

Read the data with the offset information from a stream.

Object Safety§

This trait is not object safe.

Implementors§