Commit graph

531 commits

Author SHA1 Message Date
Yoshua Wuyts
1341fa7add
cargo fmt
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-16 15:34:06 +02:00
Yoshua Wuyts
6e5f29fa58
document feature flags
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-16 14:54:19 +02:00
Yoshua Wuyts
dc664786c9
document feature flags
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-16 14:46:56 +02:00
Yoshua Wuyts
ab112e9f39
expose IoSlice, IoSliceMut
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-16 14:22:52 +02:00
Yoshua Wuyts
9c82d5e3f3
remove custom log tools in favor of macro crate
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-16 14:07:06 +02:00
bors[bot]
be123b2ec5
Merge #198
198: Remove Unpin bound in `impl Stream for T` r=stjepang a=tirr-c

I guess this is not needed anymore since we have `poll_next` that receives `Pin` now. The original bound is moved to `Stream::next`.

Co-authored-by: Wonwoo Choi <chwo9843@gmail.com>
2019-09-16 10:41:17 +00:00
Wonwoo Choi
b70dfeab15 Require S: async_std::stream::Stream in Scan 2019-09-16 18:35:37 +09:00
Wonwoo Choi
d6ffdbce8d Remove Unpin bound in impl Stream for T 2019-09-16 18:25:46 +09:00
bors[bot]
a4d42e772b
Merge #197
197: Add io::repeat r=stjepang a=tirr-c



Co-authored-by: Wonwoo Choi <chwo9843@gmail.com>
2019-09-16 08:27:46 +00:00
Wonwoo Choi
689b3c6560 Add io::repeat 2019-09-16 16:47:17 +09:00
bors[bot]
03f5022262
Merge #195
195: Remove the Send bound from block_on r=stjepang a=stjepang



Co-authored-by: Stjepan Glavina <stjepang@gmail.com>
2019-09-16 07:31:21 +00:00
bors[bot]
f4182caa4a
Merge #196
196: Remove more Unpin bounds for Stream::scan r=stjepang a=tirr-c

cc #192. I missed the bounds on `Stream::scan` itself.

Co-authored-by: Wonwoo Choi <chwo9843@gmail.com>
2019-09-16 06:50:43 +00:00
bors[bot]
c6fecbd4ef
Merge #171
171: Add BufRead::consume r=stjepang a=yoshuawuyts

Ref #131. This implements `BufReader::consume`. Thanks!


Note on `fill_buf`: I couldn't get the `async fn fill_buf()` to work, but tracked progress for it here: https://gist.github.com/yoshuawuyts/09bbdc7823225ca96b5e35cd1da5d581. Got some lifetimes isssues. If anyone wants to give this a shot, please do!

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-16 06:38:44 +00:00
Wonwoo Choi
e7b0fe2d2e Remove Unpin bounds more 2019-09-16 11:30:09 +09:00
bors[bot]
5f7a4433d5
Merge #192
192: Add Stream::scan r=stjepang a=tirr-c

Ref #129. The mapper function `f` is synchronous and returns bare `Option<B>`.

Asynchronous `f` seems tricky to implement right. It requires the wrapper to be self-referential, as a reference to internal state may be captured by the returned future.

Co-authored-by: Wonwoo Choi <chwo9843@gmail.com>
2019-09-15 21:38:37 +00:00
Wonwoo Choi
91e61cf6bf Remove unnecessary Unpin bounds 2019-09-15 21:18:02 +09:00
Stjepan Glavina
1d862cf604 Remove the Send bound from block_on 2019-09-15 00:36:17 +02:00
bors[bot]
ff9437d401
Merge #194
194: Add doc comment for JoinHandle drop behavior r=stjepang a=nonnontrivial

fixes #143 

Co-authored-by: Kevin Donahue <nonnontrivial@gmail.com>
2019-09-14 21:46:00 +00:00
Kevin Donahue
127feb47f9 add doc comment for join handle drop behavior 2019-09-14 16:35:27 -04:00
Wonwoo Choi
50a7db2af4 Add Stream::scan 2019-09-14 23:26:46 +09:00
Stjepan Glavina
7f71af9415 cargo fmt 2019-09-14 09:15:51 +02:00
Stjepan Glavina
a4381230b8 Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
Yoshua Wuyts
3b8e604acc
mark io::cursor as unstable
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-13 20:02:31 +02:00
Yoshua Wuyts
69c9162558
fix tests
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-13 19:58:18 +02:00
Yoshua Wuyts
a5b0acb378
AsyncBufRead for Cursor
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-13 19:58:18 +02:00
Yoshua Wuyts
0bc39e6e6c
add io::cursor
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-13 19:58:18 +02:00
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>
2019-09-13 17:52:10 +00:00
Yoshua Wuyts
fda74ac0ab
mark as unstable
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-13 19:36:57 +02:00
Yoshua Wuyts
40fb485cca
cargo fmt
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-13 19:35:18 +02:00
Yoshua Wuyts
23ca060e4c
implement DoubleEndedStream
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-13 19:35:18 +02:00
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>
2019-09-13 17:31:48 +00:00
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>
2019-09-13 16:01:58 +00:00
Yoshua Wuyts
d68d6bb052
links the timeout docs to each other
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-13 17:58:03 +02:00
Yoshua Wuyts
10fedfe97f
implement feedback for bufreader methods
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-13 02:21:36 +02:00
Yoshua Wuyts
ab0a4cb966
remove pin<self> bounds from consume
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-13 02:16:47 +02:00
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>
2019-09-12 21:24:45 +00:00
Stjepan Glavina
2818c7099f Suppress a lint that makes CI fail on windows 2019-09-12 23:24:20 +02:00
Stjepan Glavina
a7788d4610
Update .travis.yml
run CI only on specific branches
2019-09-12 18:47:21 +01:00
Stjepan Glavina
5429c2c0a3 cargo fmt 2019-09-12 18:49:09 +02:00
Stjepan Glavina
d25dae5419 Refactor the networking driver 2019-09-12 18:45:53 +02:00
Fedor Sakharov
0080a0da8c
change expect to unwrap 2019-09-12 18:15:20 +03:00
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>
2019-09-12 11:17:03 +00:00
Yoshua Wuyts
55669f5ff4
Prepare release for 0.99.5
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-12 13:17:29 +02:00
Fedor Sakharov
6c3f8af62d
fixes after #145 2019-09-11 22:07:20 +03:00
Fedor Sakharov
774550ca99
Merge branch 'master' into fs-stream-fold 2019-09-11 22:05:04 +03:00
Fedor Sakharov
3dc33f54b4
fixes after #145 2019-09-11 22:03:44 +03:00
Fedor Sakharov
9b3658244d
Merge branch 'master' into fs-stream-enumerate 2019-09-11 22:01:48 +03:00
Fedor Sakharov
18428d6bfe
housekeeping after 145 2019-09-11 21:47:52 +03:00
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>
2019-09-11 16:42:00 +00:00
bors[bot]
a296760119
Merge #182
182: Fix compilation errors on latest nightly r=yoshuawuyts a=stjepang



Co-authored-by: Stjepan Glavina <stjepang@gmail.com>
2019-09-11 15:30:21 +00:00