Commit Graph

291 Commits (e060326910b63d2c370e9e7d4fc302910e65edb4)
 

Author SHA1 Message Date
bors[bot] e060326910
Merge #177
177: implement DoubleEndedStream r=yoshuawuyts a=yoshuawuyts

Ref #129. This is the most basic version of the `DoubleEndedStream` trait. Because there is no counterpart in `futures-rs` we allow this to be implementable (not sure if we should though?).

This is not a high-priority trait to implement, with probably the most useful addition being the blanket impl over [`std::iter::Fuse`](https://doc.rust-lang.org/std/iter/struct.Fuse.html) (where we should have a `Fuse` counterpart for `Stream` also).

So I'm taking this one step at the time, and this PR introduces just the bare minimum to get things working. Thanks!

r? @stjepang @taiki-e

## Refs
- https://doc.rust-lang.org/std/iter/trait.DoubleEndedIterator.html
- #129 


Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts fda74ac0ab
mark as unstable
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts 40fb485cca
cargo fmt
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts 23ca060e4c
implement DoubleEndedStream
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
bors[bot] 3054509fd0
Merge #184
184: housekeeping after 145 r=yoshuawuyts a=montekki

Now that #145 is merged combinators can follow.
1. All combinators taking `&mut self` should imply `Self: Pin`.
2. Trait bounds are to `Stream`
3. Cleans up docs and `Debug` derives.

Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
5 years ago
bors[bot] 4241f64b1b
Merge #189
189: links the timeout docs to each other r=yoshuawuyts a=yoshuawuyts

Was talking in chat about futures timeouts, and apparently folks missed we had two different timeout functions. This links them to each other so if you find one, you also become aware of the other. Thanks!

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts d68d6bb052
links the timeout docs to each other
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
bors[bot] 8fe7347771
Merge #188
188: Refactor the networking driver r=stjepang a=stjepang

This is a big cleanup that simplifes the layer between mio and our networking driver. The `Watcher` API was pretty much entirely designed by @yoshuawuyts.

Fixes #185 

Co-authored-by: Stjepan Glavina <stjepang@gmail.com>
5 years ago
Stjepan Glavina 2818c7099f Suppress a lint that makes CI fail on windows 5 years ago
Stjepan Glavina a7788d4610
Update .travis.yml
run CI only on specific branches
5 years ago
Stjepan Glavina 5429c2c0a3 cargo fmt 5 years ago
Stjepan Glavina d25dae5419 Refactor the networking driver 5 years ago
bors[bot] 9d71584580
Merge #186
186: Prepare release for 0.99.5 r=yoshuawuyts a=yoshuawuyts

Prepares the release for `v0.99.5`. Thanks!

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts 55669f5ff4
Prepare release for 0.99.5
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Fedor Sakharov 18428d6bfe
housekeeping after 145 5 years ago
bors[bot] 2ecaf1811b
Merge #145
145: Add Stream::poll_next r=stjepang a=stjepang

Adding `poll_next` to the `Stream` trait will simplify #125.

After a discussion with @yoshuawuyts and @withoutboats, we became confident that the `Stream` trait of the future will never solely rely on `async fn next()` and will always have to rely on `fn poll_next()`.

This PR now makes our `Stream` trait implementable by end users.

I also made a few adjustments around pinning to `all()` and `any()` combinators since they take a `&mut self`, which implies `Self: Unpin`. A rule of thumb is that if a method takes a `&mut self` and then pins `self`, we *have to* require `Self: Unpin`.

Co-authored-by: Stjepan Glavina <stjepang@gmail.com>
5 years ago
bors[bot] a296760119
Merge #182
182: Fix compilation errors on latest nightly r=yoshuawuyts a=stjepang



Co-authored-by: Stjepan Glavina <stjepang@gmail.com>
5 years ago
Stjepan Glavina 0f4f0fb77e Fix a typo 5 years ago
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
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
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