Commit graph

93 commits

Author SHA1 Message Date
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>
2019-09-22 13:50:53 +00:00
Stjepan Glavina
85b80cfe9a Fuse futures in select! 2019-09-22 15:35:53 +02:00
Stjepan Glavina
17534cfffc Fuse next() future 2019-09-22 15:19:54 +02:00
Stjepan Glavina
0e3c47c3bf Fix imports in docs 2019-09-22 12:41:04 +02:00
Stjepan Glavina
217e435e8e Fix more compilation errors in the book 2019-09-22 12:03:56 +02:00
Stjepan Glavina
f2ca3f37a9 Fix build errors in docs 2019-09-22 11:47:39 +02:00
Stjepan Glavina
a97d26ca13 Fix imports in the book 2019-09-21 15:22:50 +02:00
Oleksii Kachaiev
55ea367415 Rename server functions to follow *_loop convention (#139)
Rename: server -> accept_loop, client -> connection_loop, client_writer -> connection_writer_loop
2019-09-20 09:54:48 +03:00
Stjepan Glavina
0f4f0fb77e Fix a typo 2019-09-11 17:29:33 +02:00
Stjepan Glavina
ab1e2b403a Fix compilation errors on latest nightly 2019-09-11 17:17:20 +02:00
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
2019-09-10 12:54:06 +02:00
Stjepan Glavina
bac74c2d7f
Reduce dependency on futures crate (#140)
* Add future::poll_fn

* Replace all uses of poll_fn with the new one

* Remove some uses of futures

* Simplify ReadDir and DirEntry

* Remove some use of futures from File

* Use futures subcrates

* Fix imports in docs

* Remove futures-util dependency

* Remove futures-executor-preview

* Refactor

* Require more features in the futures-preview crate
2019-09-05 01:22:41 +02:00
Aleksey Kladov
5b96fa9daa move a-chat tutorial's code to this repo 2019-09-04 21:25:54 +03:00
DCjanus
238a3c882b Implement an async version of ToSocketAddrs (#74)
* Implement an async version of ToSocketAddrs

* fix documentation issue

* genius hack: pretending to be `impl Future`

* replace `std::net::ToSocketAddrs` with `async-std::net::ToSocketAddrs`

* Move unit tests into the tests directory

* Stylistic changes

* Remove re-exports in async_std::net

* fix broken link

* some mirror changes

* remove unnecessary format

* migrate: `std::net::ToSocketAddrs` -> `async_std::net::ToSocketAddrs`

* fix typo(tutorial)

* remove unnecessary type bound

* lifetime for future
2019-09-04 20:09:49 +02:00
Yuki Okushi
532c73cf77 Fix typo in stability-guarantees.md (#136) 2019-08-31 16:15:26 +02:00
Florian Gilcher
366546b9ce
Visibly import in tasks example
Fixes #97
2019-08-26 14:39:25 -07:00
Florian Gilcher
b768a7bab7
Don't trim msg twice
Fixes #102
2019-08-26 14:35:57 -07:00
Florian Gilcher
bfaa9c510c
Import HashMap visibly in the tutorial
Fixes #101
2019-08-26 14:33:11 -07:00
Florian Gilcher
101979fcc3
Fix some final errors 2019-08-26 14:24:20 -07:00
Darin Morrison
6302805b54 Fix book tests
[ci skip]
2019-08-25 04:34:41 -07:00
Darin Morrison
58e783b194 Add empty data.csv for book tests
[ci skip]
2019-08-25 04:33:30 -07:00
Oleksii Kachaiev
34802cae7e [docs] Make sure that "All Together" code compiles (#104)
Added missing `spawn_and_log_error` function declaration
2019-08-23 17:17:12 -07:00
Zach Kemp
6d6328a9c8 use broker_handle to avoid overloading the broker fn (#100) 2019-08-23 17:16:17 -07:00
Rui Loura
794c12fe7e Fix some typos in tutorial (#98)
* fix typo in tutorial

* add async_std::io::BufReader to tutorial code

* writers in clean_shutdown.md return unit type
2019-08-23 06:37:54 -07:00
Stjepan Glavina
be616f35bf
Update sending_messages.md 2019-08-22 23:56:13 +02:00
Stjepan Glavina
c61f4c8b81
Update receiving_messages.md 2019-08-22 23:17:52 +02:00
Florian Gilcher
c9d8b197ca
Add dependencies explanation to book 2019-08-22 07:53:32 -07:00
Yoshua Wuyts
63ad786768
remove async_await feature gate
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-08-21 00:29:35 -07:00
Florian Gilcher
addda3937f
Merge branch 'master' of github.com:async-std/async-std 2019-08-19 12:19:52 +02:00
Florian Gilcher
de036b9cdb
Remove linking sentence linking to itself 2019-08-19 12:19:15 +02:00
Wesley Moore
ed81a9e23c
Fix a couple of typos in the book 2019-08-19 17:10:28 +10:00
Florian Gilcher
3b9ee1ad48
Revert "Manual: automated link checking using mdbook-linkcheck (#61)"
This reverts commit fc1774a8ad.
2019-08-18 15:21:55 +02:00
ngirard
fc1774a8ad Manual: automated link checking using mdbook-linkcheck (#61)
* travis.yml: add before_script instruction for mdbook and mdbook-linkcheck

* book.toml: add mdbook-linkcheck config options

* Update book.toml
2019-08-18 13:15:35 +02:00
Florian Gilcher
8129da9582
Merge pull request #62 from dcarosone/book-typos-and-small-edits
Book typos and small edits
2019-08-18 11:38:19 +02:00
Florian Gilcher
1fe8a28399
Merge branch 'master' into book-typos-and-small-edits 2019-08-18 11:34:26 +02:00
Florian Gilcher
3e22dc2db2
Merge pull request #59 from ngirard/patch-2
book.toml: some improvements
2019-08-18 11:28:00 +02:00
Florian Gilcher
d656882796
Merge pull request #66 from divergentdave/book-copyediting
Copyedits for the book
2019-08-18 11:25:49 +02:00
Florian Gilcher
96b821b9f3
Merge branch 'master' into patch-1 2019-08-18 11:24:59 +02:00
Anthony Dodd
f57e3142a1 Small technical correction. (#64)
Absolutely awesome work here! Just reading through the book absorbing all of the awesomeness and noticed this little bit. Let me know if you would like for me to update the corrections in any way.
2019-08-18 09:55:38 +02:00
Shady Khalifa
fd0b4d4cff missing .await (#69)
* missing .await

* Update tasks.md
2019-08-18 09:50:34 +02:00
Brad Gibson
7f9dae9e5f
Clarify async fn return type 2019-08-17 19:53:12 -07:00
David Cook
392b6df7c2 Copyedits for the book 2019-08-17 00:41:37 -05:00
Daniel Carosone
9974ff692e markup and typo nits 2019-08-17 11:58:35 +10:00
Daniel Carosone
a41b87205d distributed massages are the best 2019-08-17 11:50:59 +10:00
Daniel Carosone
6b23760c4a additional tweaks 2019-08-17 10:32:42 +10:00
Daniel Carosone
a4cccb1450 link and more apostrophes 2019-08-17 10:18:11 +10:00
Daniel Carosone
310cda671c use rust code blocks for consistent style 2019-08-17 10:16:04 +10:00
Daniel Carosone
ddb11bfb09 more wording tweaks 2019-08-17 10:07:06 +10:00
Daniel Carosone
5d7b641813 bullet character 2019-08-17 09:16:59 +10:00
Daniel Carosone
3df6c39e17 switch paragraphs around..
condense the summary and generalise the note
2019-08-17 09:15:52 +10:00