163: adds stream::filter_map combinator r=yoshuawuyts a=montekki
Implements a `flat_map` combinator. Currently the same about `ret!` as in #162 .
Also the naming should probably be `FilterMapStream`, but in that case `Take` stream should also change it's name i guess.
Stdlib: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.flat_map
Ref: #129
Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
168: Cache cargo artifacts r=yoshuawuyts a=stjepang
Supersedes #114
This does not cache `~/.cargo/registry` because it's too big.
Co-authored-by: Stjepan Glavina <stjepang@gmail.com>
165: Fix a bug in conversion of File into raw handle r=stjepang a=stjepang
Same bugfix as #148, but applied to `async_std::fs::File`.
Co-authored-by: Stjepan Glavina <stjepang@gmail.com>
151: Split io into multiple files r=stjepang a=yoshuawuyts
Counterpart to #150, splits `io::read` and `io::write` into multiple files. This is useful to prevent a single file from becoming hard to navigate as we add more combinators. No other changes were made. Ref #131. Thanks!
Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
157: More robust file implementation r=stjepang a=stjepang
This is a reimplementation of the `File`s state machine.
The previous implementation was simple and a bit naive. It was not fundamentally wrong but had surprises in some corner cases. For example, if an async read operation was started but we timed out on it, the file cursor would move even though we didn't complete the operation. The new implementation will move the cursor only when read/write operations complete successfully.
There was also a deadlock hazard in the case where multiple tasks were concurrently reading or writing to the same file, in which case some task wakeups would be lost. This PR fixes the problem.
A nice consequence of this PR: `futures-channel` is now unused, so we can remove it from the dependency list.
Co-authored-by: Stjepan Glavina <stjepang@gmail.com>
Previously all of the into_raw_fd implementations only returns a copy of
the inner RawFd, while still holding the ownership of the file
descriptor when returning for into_raw_fd. Since `self` is dropped at
the end of into_raw_fd, the returned file descriptor will actually be
closed, render the function unuseable.
The patch makes sure that into_raw_fd actually takes the ownership of
the file descriptor all the way from the inner IoHandle. To achieve
this, I have to use an Option in IoHandle to store the I/O source. It's
not pretty, but I cannot come up with a better way.
* Add future::poll_fn
* Replace all uses of poll_fn with the new one
* Remove some uses of futures
* Simplify ReadDir and DirEntry
* Remove some use of futures from File
* Use futures subcrates
* Fix imports in docs
* Remove futures-util dependency
* Remove futures-executor-preview
* Refactor
* Require more features in the futures-preview crate