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>
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>
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>
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>
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>