ferristseng / rust-ipfs-api

IPFS HTTP client in Rust
Apache License 2.0
247 stars 68 forks source link

Feature request: allow add, files_write, block_put, … to take AsyncRead or similar #58

Open jcaesar opened 4 years ago

jcaesar commented 4 years ago

The title actually says it all, but: Various getters return asynchronous streams (async_ftp::FtpSream::retr in my case, but so does e.g. cat — seems unfair to return something the library itself doesn't accept), and those cannot be easily passed to functions like add. Buffering in memory or temporary files may be expensive or even infeasible, depending on the size.

So it would be nice if some form of async stream could be passed to add and friends.

(This requires changes to rust-multipart-rfc7578, I think. I hope not to hyper, too?)

SionoiS commented 4 years ago

I currently buffer big video files in my app. I would definitely appreciate more asynchrony.

+1 from me!

SionoiS commented 4 years ago

https://github.com/cetra3/mpart-async/

Would it be useful? I'm not familiar with that kind of stuff.