Warp #39
-
Is it possible to pass the output of this warp filter to multer? I can't get it to work.
From what I can gather, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Yes, but it's not clear to me from warp's sparse documentation how to do so efficiently and correctly. The gist is that you need to convert the
All of these do much more copying and allocating than one would hope, but it's not clear to be that warp allows anything better. |
Beta Was this translation helpful? Give feedback.
-
I got #2 working, thanks a lot to both of you. Here's the code:
|
Beta Was this translation helpful? Give feedback.
Yes, but it's not clear to me from warp's sparse documentation how to do so efficiently and correctly. The gist is that you need to convert the
impl Buf
(note thatBuf
is a trait, not a concrete type) into something that implementsInto<Bytes>
. Here are some ideas:Bytes
using copy_to_bytes on theimpl Buf
.stream
.multer
.All of these do much more copying and allocating than one would hope, but it's not clear to be that warp allows anything better.