Trait Body

Source
pub trait Body {
    // Required methods
    fn poll_chunk(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
        buf: &mut [u8],
    ) -> Poll<Result<usize>>;
    fn poll_chunk_size_hint(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
    ) -> Poll<Result<(usize, Option<usize>)>>;
    fn size_hint(&self) -> (usize, Option<usize>);
}

Required Methods§

Source

fn poll_chunk( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<Result<usize>>

Source

fn poll_chunk_size_hint( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(usize, Option<usize>)>>

Source

fn size_hint(&self) -> (usize, Option<usize>)

Implementations on Foreign Types§

Source§

impl Body for ()

Source§

fn poll_chunk( self: Pin<&mut Self>, _cx: &mut Context<'_>, _buf: &mut [u8], ) -> Poll<Result<usize>>

Source§

fn poll_chunk_size_hint( self: Pin<&mut Self>, _cx: &mut Context<'_>, ) -> Poll<Result<(usize, Option<usize>)>>

Source§

fn size_hint(&self) -> (usize, Option<usize>)

Source§

impl<T> Body for Cursor<T>
where T: AsRef<[u8]> + Unpin,

Source§

fn poll_chunk( self: Pin<&mut Self>, _cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<Result<usize>>

Source§

fn poll_chunk_size_hint( self: Pin<&mut Self>, _cx: &mut Context<'_>, ) -> Poll<Result<(usize, Option<usize>)>>

Source§

fn size_hint(&self) -> (usize, Option<usize>)

Implementors§