feat(http): allow specifying custom body streams

This commit is contained in:
Sean McArthur
2017-02-16 12:39:50 -08:00
parent 2266d869ca
commit 1b1311a7d3
11 changed files with 384 additions and 276 deletions

View File

@@ -1,5 +1,4 @@
use std::convert::From;
use std::sync::Arc;
use tokio_proto;
use http::Chunk;
@@ -65,12 +64,6 @@ impl From<Vec<u8>> for Body {
}
}
impl From<Arc<Vec<u8>>> for Body {
fn from (vec: Arc<Vec<u8>>) -> Body {
Body(TokioBody::from(Chunk::from(vec)))
}
}
impl From<&'static [u8]> for Body {
fn from (slice: &'static [u8]) -> Body {
Body(TokioBody::from(Chunk::from(slice)))