refactor(client): remove Unpin requirement from request body

This commit is contained in:
Sean McArthur
2019-12-11 14:05:07 -08:00
parent 52cc3f7367
commit a07142da2d
3 changed files with 6 additions and 7 deletions

View File

@@ -332,7 +332,6 @@ impl<T, B> Connection<T, B>
where
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
B: Payload + Unpin + 'static,
B::Data: Unpin,
{
/// Return the inner IO object, and additional information.
///
@@ -384,7 +383,7 @@ where
impl<T, B> Future for Connection<T, B>
where
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
B: Payload + Unpin + 'static,
B: Payload + 'static,
{
type Output = crate::Result<()>;
@@ -591,7 +590,7 @@ impl fmt::Debug for ResponseFuture {
impl<T, B> Future for ProtoClient<T, B>
where
T: AsyncRead + AsyncWrite + Send + Unpin + 'static,
B: Payload + Unpin + 'static,
B: Payload + 'static,
{
type Output = crate::Result<proto::Dispatched>;

View File

@@ -152,7 +152,7 @@ where
C: Connect + Clone + Send + Sync + 'static,
C::Transport: Unpin + Send + 'static,
C::Future: Unpin + Send + 'static,
B: Payload + Unpin + Send + 'static,
B: Payload + Send + 'static,
B::Data: Send,
{
/// Send a `GET` request to the supplied `Uri`.
@@ -550,7 +550,7 @@ where
C: Connect + Clone + Send + Sync + 'static,
C::Transport: Unpin + Send + 'static,
C::Future: Unpin + Send + 'static,
B: Payload + Unpin + Send + 'static,
B: Payload + Send + 'static,
B::Data: Send,
{
type Response = Response<Body>;

View File

@@ -91,7 +91,7 @@ where
impl<B> Future for ClientTask<B>
where
B: Payload + Unpin + 'static,
B: Payload + 'static,
{
type Output = crate::Result<Dispatched>;
@@ -133,7 +133,7 @@ where
};
if !eos {
let mut pipe = PipeToSendStream::new(body, body_tx).map(|res| {
let mut pipe = Box::pin(PipeToSendStream::new(body, body_tx)).map(|res| {
if let Err(e) = res {
debug!("client request body error: {}", e);
}