mongo-rust-driver
mongo-rust-driver copied to clipboard
RUST-1399 Implement `AsyncRead` for `GridFsDownloadStream`
Implements the streaming API for GridFS downloads. Some relevant reading related to the async stuff going on here:
- This forum thread which discusses caching futures.
-
tokio
's implementation of theAsyncRead
trait forFile
. This istokio
'sAsyncRead
rather thanfuture
's but demonstrates future caching and a similar state machine.
I'm going to add some unit tests to cover cases related to buffer size and reading into multiple buffers, but I wanted to request review on this now to get some feedback while I'm away.