Closed aksiksi closed 4 years ago
For each attachment:
I did some basic profiling (release build) to compare approaches. For an ~8 MB email with 3 attachments:
See graphs (courtesy of massif-visualizer
):
See https://github.com/seanmonstar/warp/issues/448 for how to use this.
Reqwest implements
From<Response>
forBody
. This means that a request body can be set for a pending response. It is not clear if the content is streamed or not.For
Attachment
, we can set thecontent
filed to point to an enum like so:Note that you can convert a
Response
into aStream
, and then pass that on. Or we can use thechunk
method. See: https://docs.rs/reqwest/0.10.0/reqwest/struct.Response.html#method.bytes_stream