Trait tonic::body::Body[][src]

pub trait Body: Sealed + Send + Sync {
    type Data: Buf;
    type Error: Into<Box<dyn Error + Send + Sync>>;
    fn is_end_stream(&self) -> bool;
fn poll_data(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>
    ) -> Poll<Option<Result<Self::Data, Self::Error>>>;
fn poll_trailers(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>
    ) -> Poll<Result<Option<HeaderMap>, Self::Error>>; }

A trait alias for http_body::Body.

Associated Types

type Data: Buf[src]

The body data type.

type Error: Into<Box<dyn Error + Send + Sync>>[src]

The errors produced from the body.

Loading content...

Required methods

fn is_end_stream(&self) -> bool[src]

Check if the stream is over or not.

Reference http_body::Body::is_end_stream.

fn poll_data(
    self: Pin<&mut Self>,
    cx: &mut Context<'_>
) -> Poll<Option<Result<Self::Data, Self::Error>>>
[src]

Poll for more data from the body.

Reference http_body::Body::poll_data.

fn poll_trailers(
    self: Pin<&mut Self>,
    cx: &mut Context<'_>
) -> Poll<Result<Option<HeaderMap>, Self::Error>>
[src]

Poll for the trailing headers.

Reference http_body::Body::poll_trailers.

Loading content...

Implementors

impl<T> Body for T where
    T: HttpBody + Send + Sync + 'static,
    T::Error: Into<Box<dyn Error + Send + Sync>>, 
[src]

type Data = T::Data

type Error = T::Error

Loading content...