Commit Graph

584 Commits (3491fbc01b75444c3fbb502228df21e6a5be4098)
 

Author SHA1 Message Date
bors[bot] 1d2838b63b
Merge #234
234: Re-export Stream from futures r=stjepang a=stjepang

This is a follow-up to #224

Co-authored-by: Stjepan Glavina <stjepang@gmail.com>
5 years ago
Stjepan Glavina c62b7a0ba9 Fix warnings 5 years ago
Stjepan Glavina 73d7fea937 Re-export Stream from futures 5 years ago
bors[bot] 33ff41df48
Merge #224
224: Re-export IO traits from futures r=stjepang a=stjepang

Sorry for the big PR!

Instead of providing our own traits `async_std::io::{Read, Write, Seek, BufRead}`, we now re-export `futures::io::{AsyncRead, AsyncWrite, AsyncSeek, AsyncRead}`. While re-exporting we rename them to strip away the "Async" prefix.

The documentation will display the contents of the original traits from the `futures` crate together with our own extension methods. There's a note in the docs saying the extenion methods become available only when `async_std::prelude::*` is imported.

Our extension traits are re-exported into the prelude, but are marked with `#[doc(hidden)]` so they're completely invisible to users.

The benefit of this is that people can now implement traits from `async_std::io` for their types and stay compatible with `futures`. This will also simplify some trait bounds in our APIs - for example, things like `where Self: futures_io::AsyncRead`.

At the same time, I cleaned up some trait bounds in our stream interfaces, but haven't otherwise fiddled with them much.

I intend to follow up with another PR doing the same change for `Stream` so that we re-export the stream trait from `futures`.

Co-authored-by: Stjepan Glavina <stjepang@gmail.com>
5 years ago
Stjepan Glavina 85b80cfe9a Fuse futures in select! 5 years ago
bors[bot] ff7b5d3123
Merge #233
233: adds stream::chain combinator r=stjepang a=montekki

Adds a `Chain` combinator and Introduces some changes to `Fuse` so it's usable in this case, but those need a closer look. 

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

Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
5 years ago
Stjepan Glavina 17534cfffc Fuse next() future 5 years ago
Fedor Sakharov 2a2a473889
adds stream::chain combinator 5 years ago
Stjepan Glavina d55cfb1da8 impl FusedStream for Fuse 5 years ago
Stjepan Glavina 0e3c47c3bf Fix imports in docs 5 years ago
Stjepan Glavina 797a6b2d90 Add a missing assert in a doc example 5 years ago
Stjepan Glavina bfab20da03 Don't re-export ext traits in async_std::io 5 years ago
Stjepan Glavina 217e435e8e Fix more compilation errors in the book 5 years ago
Stjepan Glavina f2ca3f37a9 Fix build errors in docs 5 years ago
bors[bot] 697a7207cb
Merge #230
230: fixes merge artifacts in stream docs r=stjepang a=montekki



Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
5 years ago
Fedor Sakharov 89fd473da0
fixes merge artifacts in stream docs 5 years ago
bors[bot] a8e48b1542
Merge #226
226: adds stream::step_by combinator r=stjepang a=montekki

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

Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
5 years ago
Fedor Sakharov 376049b51d
Merge branch 'master' into fs-stream-step-by 5 years ago
bors[bot] 6470130cb1
Merge #227
227: adds stream::inspect combinator r=stjepang a=montekki

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

Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
5 years ago
Fedor Sakharov bf7121d2d4
adds stream::inspect combinator 5 years ago
Fedor Sakharov e74c0cec1f
adds stream::step_by combinator 5 years ago
bors[bot] 2acc07065c
Merge #223
223: adds stream::skip_while combinator r=stjepang a=montekki

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

Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
5 years ago
Fedor Sakharov ea080e7305
Merge branch 'master' into fs-stream-skip-while 5 years ago
bors[bot] 99724497b3
Merge #221
221: adds stream::filter combinator r=stjepang a=montekki

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

Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
5 years ago
bors[bot] 47ce009e10
Merge #222
222: adds stream::skip combinator r=stjepang a=montekki

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

Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
5 years ago
Fedor Sakharov fdd81e1b2a
Actually export Skip 5 years ago
Fedor Sakharov e430851bc4
export Filter type 5 years ago
Fedor Sakharov 75da138696
export Skip type 5 years ago
Fedor Sakharov 93463e8df3
export SkipWhile type 5 years ago
Stjepan Glavina a97d26ca13 Fix imports in the book 5 years ago
Stjepan Glavina 53ce30ae66
Fix async_std imports in metadata.rs 5 years ago
Stjepan Glavina 1fa196812a Fix compilation errors around Stream 5 years ago
Stjepan Glavina edfa2358a4 Re-export IO traits from futures 5 years ago
Fedor Sakharov f9f97c43c4
adds stream::skip_while combinator 5 years ago
Fedor Sakharov 570329b176
adds stream::skip combinator 5 years ago
Fedor Sakharov e7ae10ebee
adds stream::filter combinator 5 years ago
Oleksii Kachaiev 55ea367415 Rename server functions to follow *_loop convention (#139)
Rename: server -> accept_loop, client -> connection_loop, client_writer -> connection_writer_loop
5 years ago
bors[bot] 4aceee1b61
Merge #218
218: expose sync::{Arc,Weak} r=stjepang a=yoshuawuyts

Ref #217. Exposes `std::sync::Arc` and `std::sync::Weak`. Thanks!

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts fa31c6347e
expose sync::{Arc,Weak}
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
bors[bot] 8be7655672
Merge #216
216: fix unstable display for pin docs r=yoshuawuyts a=yoshuawuyts

On https://docs.rs/async-std/0.99.6/async_std/ `pin` is not properly showing up as "unstable" despite being guarded as such. This fixes that. Thanks!

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts 42fac26761
fix unstable display for pin docs
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
bors[bot] 47194353c8
Merge #215
215: prepare v0.99.6 r=yoshuawuyts a=yoshuawuyts

Prepares us for the next release. Thanks!

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts 8d31aa69cf
prepare v0.99.6
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
bors[bot] f45b39d7c0
Merge #208
208: add stream::join r=stjepang a=yoshuawuyts

Ref #129 #187. This adds the `stream::join` which can join multiple streams into a single stream. Thanks!

## Example
```rust
let a = stream::once(1u8);
let b = stream::once(2u8);
let c = stream::once(3u8);

let mut s = stream::join!(a, b, c);

assert_eq!(s.collect().await, vec![1u8, 2u8, 3u8]);
```

## Screenshot

![Screenshot_2019-09-17 async_std stream - Rust](https://user-images.githubusercontent.com/2467194/65080099-cedb8b00-d9a0-11e9-984f-edd7d6bad5cc.png)


Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts 7fe6c8a42c
add stream::join
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Wonwoo Choi 9c00d0b903 Rename: extend_with_stream => stream_extend 5 years ago
Wonwoo Choi a5a6dc24c4 Add stream::Extend 5 years ago
bors[bot] 91f002d12b
Merge #209
209: add feature guards for unstable features r=yoshuawuyts a=yoshuawuyts

Makes sure unstable features aren't accidentally usable without their corresponding flags. Thanks!

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
Co-authored-by: Yoshua Wuyts <yoshuawuyts+github@gmail.com>
5 years ago
Yoshua Wuyts bd43490d72
fix cargo test --doc
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts c533d5f906
implement feedback & fix tests
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago