Allow streaming binary http bodies
Related: #603
How would this work? Would we allow streaming on only some request/response types, or will we switch to a Into<&[u8]>-able streaming type?
Useful for https://gitlab.com/famedly/conduit/-/issues/93
I have only a very rough idea of how this could work in my head. It would involve making the request / response traits generic, rather than having them contain a generic method, making the raw_body request / response types generic over the raw_body type and using different bounds for their request / response trait implementations. I might be able to work on this over the weekend.
If you don't want to do this in ruma, it's probably rather simple for conduit to not use ruma on that endpoint.
I definitely want to do this in Ruma, but don't know when I'll get to it or how hard it will be. If sbd. wants to help, let's discuss the implementation on #ruma-dev.
Rocket's code might be worth looking at: https://api.rocket.rs/v0.5-rc/rocket/fs/struct.NamedFile.html
The hard part is not how to stream http bodies, the hard part is integrating this with ruma-api's request / response traits.
Is an specific stream-able type too restrictive? It should be generic?
I think it should be generic, so users can choose between different async File types or in-memory types such as hyper::Body / reqwest::Body.