Skip to main content

RequestStream

Trait RequestStream 

Source
pub trait RequestStream {
    // Required methods
    fn poll_next(
        &mut self,
        context: &mut Context<'_>,
    ) -> Poll<Option<Result<(), StreamError>>>;
    fn chunk(&self) -> &[u8] ;
}

Required Methods§

Source

fn poll_next( &mut self, context: &mut Context<'_>, ) -> Poll<Option<Result<(), StreamError>>>

Advances to the next chunk without transferring its allocation.

After returning Poll::Ready(Some(Ok(()))), chunk must expose the new chunk until the next mutable call to this stream.

Source

fn chunk(&self) -> &[u8]

Borrows the chunk produced by the latest successful poll_next call.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§