1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-09-09 05:08:32 +00: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.