Relax body requirements by removing 'static
bound
#3752
Labels
C-feature
Category: feature. This is adding a new feature.
'static
bound
#3752
For now to send any requests you need request's body to be
'static
: handshakeI think this restriction is unnecessary for many async runtimes that allow borrowing external environment. My proposal is to remove this restriction, allowing types such as
Full<&'a [u8]>
to be used as a body. Besides, it may simplify the public API a little bit.This can be done for http1. But the implementation of the http2 requires a downcasting of body's
Data
, so it must be'static
. Anyway, even<B as Body>::Data: 'static
is less restrictive thanB: Body + 'static
, it allows to use some borrowed body that produces static chunks of data. I'm not sure if it's possible to relax this restriction too. Maybe something can be invented in the futureThe text was updated successfully, but these errors were encountered: