Implement try_clone for async requests (#698)

Fixes #533
This commit is contained in:
tobdob
2019-11-05 03:14:40 +01:00
committed by Sean McArthur
parent f6f81f9cc1
commit 3a50ed11f8
2 changed files with 98 additions and 0 deletions

View File

@@ -125,6 +125,13 @@ impl Body {
(reuse, self)
}
pub(crate) fn try_clone(&self) -> Option<Body> {
match self.inner {
Inner::Reusable(ref chunk) => Some(Body::reusable(chunk.clone())),
Inner::Streaming { .. } => None,
}
}
pub(crate) fn into_stream(self) -> ImplStream {
ImplStream(self)
}