Commit Graph

530 Commits (staging)
 

Author SHA1 Message Date
Stjepan Glavina ab1e2b403a Fix compilation errors on latest nightly 5 years ago
Stjepan Glavina 2497f4d3e1 Merge branch 'master' into poll_next 5 years ago
Stjepan Glavina 724a9f4eb0 Add Stream::poll_next 5 years ago
Wonwoo Choi 06f2569d23 Add BufRead::fill_buf (#176)
* Add BufRead::fill_buf

* Make FillBufFuture constructor pub(crate)

* Give more information about the transmutation source type
5 years ago
Fedor Sakharov cdd4215e8f
forgot None case 5 years ago
Fedor Sakharov 2d75ffacc4
fixes example to resemble std more 5 years ago
Fedor Sakharov 5b720ab1e2
adds stream::fold combinator 5 years ago
bors[bot] 568f6a6482
Merge #179
179: adds stream::find combinator r=yoshuawuyts a=montekki

A find combinator
---
Stdlib: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.find
Ref: #129 

Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
5 years ago
Fedor Sakharov 97a5f9b50c
adds stream::find combinator 5 years ago
Fedor Sakharov ed944d051a
adds stream::enumerate combinator 5 years ago
bors[bot] 6f9ec665a2
Merge #174
174: adds stream::find_map combinator r=yoshuawuyts a=montekki

Adds a `stream::find_map` combinator
---
Stdlib: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.find_map
Ref: #129 

Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
5 years ago
Fedor Sakharov efb8415429
Merge branch 'master' into fs-stream-find-map 5 years ago
bors[bot] 6d1e71fb68
Merge #163
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>
5 years ago
bors[bot] a0c9442261
Merge #166
166: adds stream::nth combinator r=yoshuawuyts a=montekki

Implements `nth` combinator.

---
Stdlib: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.nth
Ref: #129 

Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
5 years ago
Fedor Sakharov 9b381e427f
Apply suggestions from code review
Co-Authored-By: Yoshua Wuyts <yoshuawuyts+github@gmail.com>
5 years ago
bors[bot] c3f6a5174b
Merge #168
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>
5 years ago
Fedor Sakharov 272f74c1da fixes to stream::min_by (#162)
* fixes to stream::min_by

* no reason to split these impls

* remove Debug derive from MinByFuture
5 years ago
James Munns a8090be3eb Fix book to use futures_channel and futures_util, re-enable testing (#172)
* Fix book to use futures_channel and futures_util, re-enable testing

* Make dev dependencies for the book explicit
5 years ago
Florian Gilcher 7d635b3200
Merge pull request #173 from async-rs/fix-doc-warning
Add link to silence doc warning
5 years ago
Fedor Sakharov 45bd0ef13d
adds stream::find_map combinator 5 years ago
James Munns 6db71e597b Add link to silence doc warning 5 years ago
Fedor Sakharov 43b7523c69
remove Debug derive from NthFuture 5 years ago
Stjepan Glavina 714e173948 Cache cargo artifacts 5 years ago
Stjepan Glavina 2c02037673 Fix a typo 5 years ago
bors[bot] b849669998
Merge #165
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>
5 years ago
bors[bot] 7c05356ef4
Merge #148
148: Make sure into_raw_fd doesn't close the file descriptor r=stjepang a=yshui

Closes #147 

Co-authored-by: Yuxuan Shui <yshuiv7@gmail.com>
Co-authored-by: yshui <yshuiv7@gmail.com>
5 years ago
yshui 8e2bf24456
Apply suggestions from code review
Co-Authored-By: Stjepan Glavina <stjepang@gmail.com>
5 years ago
Fedor Sakharov 45cd3b0894
adds stream::nth combinator 5 years ago
Stjepan Glavina 41f345d319 Fix a bug in conversion of File into raw handle 5 years ago
Yoshua Wuyts 9bf06ce52b fix io::copy link (#164)
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Fedor Sakharov 55bdea4649
adds stream::filter_map combinator 5 years ago
bors[bot] 63f3a809aa
Merge #161
161: Split BufRead into multiple files r=stjepang a=stjepang



Co-authored-by: Stjepan Glavina <stjepang@gmail.com>
5 years ago
Yoshua Wuyts ba43a05d01 split stream into multiple files (#150)
* split stream into multiple files

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>

* cargo fmt

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts be71ac9d76 update deps (#149)
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Stjepan Glavina 55550c6fc9 Split BufRead into multiple files 5 years ago
Stjepan Glavina 8c00cc53ce Flush more often to prevent flushes during seek 5 years ago
bors[bot] 8d3d80a678
Merge #151
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>
5 years ago
bors[bot] a8a2ae9e29
Merge #157
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>
5 years ago
Stjepan Glavina 6ed0e857fd Fix some typos, expand comments 5 years ago
bors[bot] cc9e078d1b
Merge #160
160: add io::prelude r=stjepang a=yoshuawuyts

I was working on some async io code earlier, and ended up writing:
```rust
    use async_std::io::{BufReader, BufRead, Read};
```

It took a bit of trial and error to get the right traits in scope, and I kind of wished I had `io::prelude` available so it would *just work*. Which is why this patch adds `io::prelude`. I guess I'm kind of circling back on the idea of only having a single prelude; but overall I think this feels more intuitive. Thanks!

## Screenshots
![Screenshot_2019-09-08 async_std io - Rust](https://user-images.githubusercontent.com/2467194/64481454-8e2f8500-d1dc-11e9-9299-7a82b7dbb031.png)
![Screenshot_2019-09-08 async_std io prelude - Rust](https://user-images.githubusercontent.com/2467194/64481455-8e2f8500-d1dc-11e9-9d20-1e90fabccaf4.png)
![Screenshot_2019-09-08 std io prelude - Rust](https://user-images.githubusercontent.com/2467194/64481509-bfa85080-d1dc-11e9-9965-be7d0d84b551.png)



Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts ec1f33fe62
inline better
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts b1d85ab460
add io::prelude
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Stjepan Glavina 17c95a39d7
More robust file implementation
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts 910801e2d6
fix doc compile
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts e1137345d4
cargo fmt
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts 4a2194f37c
split io::write into multiple files
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts a90100962d
split io::read into multiple files
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts 98d9284e64
disable mdbook to allow tests to pass again (#159)
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Florian Gilcher f27f927d1d
Merge pull request #156 from montekki/fs-fix-153
append doc example for io::buf_read::read_until
5 years ago
Fedor Sakharov 91a66c2d94
append doc example for io::buf_read::read_until 5 years ago