Hyper: try_concat() stopped working in alpha.2 ?

Created on 25 Sep 2019  路  3Comments  路  Source: hyperium/hyper

   |     let body = match resp.into_body().try_concat().await {
   |                                       ^^^^^^^^^^ method not found in `hyper::body::body::Body`
   |
   = note: the method `try_concat` exists but the following trait bounds were not satisfied:
           `&hyper::body::body::Body : futures_util::try_stream::TryStreamExt`
           `&mut hyper::body::body::Body : futures_util::try_stream::TryStreamExt`
           `hyper::body::body::Body : futures_util::try_stream::TryStreamExt`

Most helpful comment

Looks like adding "unstable-stream" feature helps. Closing this.

All 3 comments

Looks like adding "unstable-stream" feature helps. Closing this.

It seems like this stopped working again since the bytes 0.5 crate removed Extend<u8> from Bytes.

This is the best I could come up with so far, but this seems very much like a workaround:

let bytes = request.into_body()
    .and_then(move |bytes| async { Ok(BytesMut::from_iter(bytes)) })
    .try_concat()
    .await?
    .to_vec();

Does anyone have a better solution?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrjoe7 picture mrjoe7  路  4Comments

FGRibreau picture FGRibreau  路  4Comments

alex picture alex  路  4Comments

toplinuxsir picture toplinuxsir  路  3Comments

nate-onesignal picture nate-onesignal  路  3Comments