1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-27 17:52:56 +01:00

add Stream impl for ResponseBody

This commit is contained in:
Nikolay Kim 2019-03-05 21:19:12 -08:00
parent 34c8b95a35
commit 889d67a356

View File

@ -91,6 +91,15 @@ impl<B: MessageBody> MessageBody for ResponseBody<B> {
}
}
impl<B: MessageBody> Stream for ResponseBody<B> {
type Item = Bytes;
type Error = Error;
fn poll(&mut self) -> Poll<Option<Self::Item>, Self::Error> {
self.poll_next()
}
}
/// Represents various types of http message body.
pub enum Body {
/// Empty response. `Content-Length` header is not set.