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>>;
}
Expand description
A trait alias for http_body::Body
.
Required Associated Types
Required Methods
sourcefn is_end_stream(&self) -> bool
fn is_end_stream(&self) -> bool
Check if the stream is over or not.
Reference http_body::Body::is_end_stream
.
Poll for more data from the body.
Reference http_body::Body::poll_data
.