ReadChunk

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§