Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 17: Async and Await #4037

Merged
merged 280 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
280 commits
Select commit Hold shift + click to select a range
3cf4fae
Ch. 17: corrections/discussion on runtimes, mostly
chriskrycho May 10, 2024
c3ebabe
Ch. 17: pull disconnected material out of 17.01
chriskrycho May 10, 2024
5657a49
Ch. 17: minor wording improvement
chriskrycho May 10, 2024
dbd5e14
Ch. 17: use `Listing` for all existing listings
chriskrycho May 14, 2024
b4e3030
Ch. 17: eliminate duplicate runtime description
chriskrycho May 14, 2024
96fd725
Merge `main` into `only-new-async`
chriskrycho May 14, 2024
95105d2
Ch. 17: Add `futures` to `trpl` crate for re-exports
chriskrycho May 14, 2024
f418ceb
Ch. 17: abandon attempt to re-export `tokio::main`
chriskrycho May 14, 2024
8e7420e
Ch. 17: start in earnest on §2, showing relation to threads
chriskrycho May 14, 2024
1ee7975
Ch. 17: add more examples and explanation to §02.
chriskrycho May 15, 2024
9c1f4c8
Ch. 17: Finish 'Counting', start on 'Async Move Blocks'
chriskrycho May 15, 2024
dacddb5
Merge `main` into `only-new-async`
chriskrycho May 16, 2024
c1c3c7f
Ch. 17: start on message-passing and `async move` in §2
chriskrycho May 16, 2024
4b7886e
Ch. 17: Finish a pass on Message Passing example
chriskrycho May 17, 2024
b835c07
Merge `main` into `only-new-async`
chriskrycho May 22, 2024
5e09f02
Merge `main` into `only-new-async`
chriskrycho May 22, 2024
5483299
Exclude `trpl` from workspace
chriskrycho May 22, 2024
acde825
Ch. 17: skip `main` and `trpl::block_on` in some listings
chriskrycho May 22, 2024
7b14d7d
Ch. 17: inline some note content and fix some phrasing
chriskrycho May 22, 2024
89b3b25
Merge `main` into `only-new-async`
chriskrycho May 22, 2024
1d7c987
Ch. 17: Rewrite listings to be more similar to Ch. 16
chriskrycho May 22, 2024
1db4ee2
Ch. 17: wording and structure tweaks
chriskrycho May 22, 2024
af18d2b
Ch. 17: show multiple producers working with `clone`
chriskrycho May 22, 2024
b3fe5b7
Merge `main` into `only-new-async`
chriskrycho May 23, 2024
c1847bf
Ch. 17: restructure §00 and start better motivating async
chriskrycho May 23, 2024
1010b1f
Ch. 17: further motivation for async w/examples
chriskrycho May 24, 2024
8ce6c8a
Ch. 17: rework §00 to talk about reads instead of writes
chriskrycho May 24, 2024
52bf9e4
Ch. 17: extract parallelism discussion from §00 to §03
chriskrycho May 24, 2024
3224ceb
Ch. 17: dedicate §03 to 'Futures, Tasks, and Threads'
chriskrycho May 27, 2024
82f47c3
Ch. 17: Listings are all `17-*`!
chriskrycho May 27, 2024
91ffec8
Ch. 17: Fill out message-passing example
chriskrycho May 27, 2024
d3d7c64
Merge `main` into `only-new-async`
chriskrycho May 27, 2024
91348ca
Ch. 17: A minor wording improvement
chriskrycho May 27, 2024
068f30b
Ch 17.02: motivating `futures::join!` and `Box::pin`
chriskrycho May 27, 2024
7a5bdb2
Ch. 17: finish motivating `Pin` and `pin!`
chriskrycho May 28, 2024
626aec8
Ch. 17: A small wording tweak about `JoinAll` in §03
chriskrycho May 28, 2024
40a3dc1
Merge `main` into `only-new-async`
chriskrycho May 28, 2024
b382767
Ch. 17: Start building out explanation of `Pin`
chriskrycho May 28, 2024
e000ea3
Ch. 17: Iterate on explanation of `Pin` and `Unpin`
chriskrycho May 29, 2024
0032e07
Ch. 17: iterate on §02 examples, extract “extra” material
chriskrycho May 29, 2024
4236371
Ch. 17: Explain `join!` in §02
chriskrycho May 30, 2024
97f5bcc
Ch. 17 §02: Clarify the `move` discussion
chriskrycho May 30, 2024
888a519
Merge `main` into `only-new-async`
chriskrycho May 30, 2024
c6965ca
Ch. 17 §02: Start showing timeouts
chriskrycho May 30, 2024
c58f943
Ch. 17 §02: Start on example of select.
chriskrycho May 30, 2024
7da440a
Ch. 17 §02: Implement `timeout` example and building blocks
chriskrycho Jun 5, 2024
270780a
Ch. 17: build a `retry` implementation
chriskrycho Jun 5, 2024
1c27c97
Ch. 17: Drop material about `retry`, since it is a hazard
chriskrycho Jun 5, 2024
71acd6d
Ch. 17 §02: Write about `race` and `yield_now`
chriskrycho Jun 5, 2024
5a0fb42
Ch. 17: Split the over-long §02 into two parts
chriskrycho Jun 6, 2024
86835d6
Ch. 17: Show worked example of implementing `timeout`
chriskrycho Jun 6, 2024
a364865
Ch. 17 §04: Show perforance of `sleep` vs. `yield_now`
chriskrycho Jun 6, 2024
f4cd9d2
Ch. 17 §01: rephrase note about the details we don’t get into
chriskrycho Jun 7, 2024
b5010d1
Ch. 17 §01: Add necessary background for §04 to make sense
chriskrycho Jun 7, 2024
13adef4
Ch. 17 §04: Explain the *implications* of yielding to motivate it
chriskrycho Jun 7, 2024
54a18a7
Ch. 17 §04: explain yield better and rework examples
chriskrycho Jun 7, 2024
e56e906
Ch. 17 §04: Add a good transition sentence
chriskrycho Jun 7, 2024
95422ab
Ch. 17 §04: add a Note about cooperative multitasking
chriskrycho Jun 7, 2024
b3931ef
Ch. 17 §03: Add more explanatory material on `Pin`
chriskrycho Jun 7, 2024
8809d9f
Ch. 17: a better name for one of the internal sections
chriskrycho Jun 7, 2024
121f5b6
Ch. 17 §03: Explain pinning and `Deref` just enough
chriskrycho Jun 10, 2024
a97358e
Ch. 17 §03: Finish a first pass on explaining `Pin`
chriskrycho Jun 10, 2024
644bc54
Ch. 17 §04: Code sample and incomplete sentence fixes
chriskrycho Jun 10, 2024
b796ff8
Merge `main` into `only-new-async`
chriskrycho Jun 11, 2024
f786162
Ch. 17 §04: Give the section a reasonable title
chriskrycho Jun 11, 2024
39485b9
Merge `main` into `only-new-async`
chriskrycho Jun 12, 2024
617b755
Ch. 17: an editing pass on §00 and the start of §01
chriskrycho Jun 12, 2024
2360484
Ch. 17: reduce dependency list for `trpl` crate
chriskrycho Jun 12, 2024
5458a6a
Ch. 17: correct listing numbers for §01
chriskrycho Jun 12, 2024
217645e
Ch. 17 §01: flag a TODO item for later
chriskrycho Jun 12, 2024
c310f54
Ch. 17: Finish (first pass) documentation for `trpl::race`
chriskrycho Jun 12, 2024
69323d9
Ch. 17 §02: correct numbering and content for Listing 17-04
chriskrycho Jun 13, 2024
dc0ce20
Merge `main` into `only-new-async`
chriskrycho Jun 13, 2024
ccd6808
Ch. 17 §02: correct numbering and content for Listing 17-05
chriskrycho Jun 13, 2024
4c4ebb7
Ch. 17 §02: correct numbering and content for Listing 17-06
chriskrycho Jun 13, 2024
4c41d8f
Ch. 17 §02: remove listing that I split into multiple parts
chriskrycho Jun 13, 2024
6fd549d
Ch. 17 §02: correct numbering and content for Listing 17-07
chriskrycho Jun 13, 2024
bd26083
Ch. 17 §02: leave a TODO about one bucket of output
chriskrycho Jun 13, 2024
6d802a0
Ch. 17 §02: correct numbering and content for Listings 17-08 and 17-09
chriskrycho Jun 13, 2024
38ddc49
Ch. 17 §02: correct numbering and content for Listings 17-10 and 17-11
chriskrycho Jun 13, 2024
60cde00
Ch. 17 §02: correct numbering and content for Listing 17-12
chriskrycho Jun 13, 2024
7e5b6f2
Ch. 17 §02: correct numbering and content for Listings 17-13 and 17-14
chriskrycho Jun 13, 2024
766ad04
Ch. 17 §02: correct numbering and content for Listings 17-15 and 17-16
chriskrycho Jun 13, 2024
c308400
Ch. 17 §03: correct numbering and content for Listings 17-17
chriskrycho Jun 13, 2024
6035ba4
Ch. 17 §03: correct numbering and content for Listing 17-18
chriskrycho Jun 13, 2024
a1eb8ae
Ch. 17: Fix internal links
chriskrycho Jun 13, 2024
911167d
Ch. 17: Remove completed `TODO` for `Pin` 🎉
chriskrycho Jun 13, 2024
b8ecdb5
Ch. 17 §03: extract a no-listing for type mismatches
chriskrycho Jun 13, 2024
2b65e53
Ch. 17 §03: correct numbering and content for Listings 17-19 and 17-20
chriskrycho Jun 13, 2024
67bd0a0
Ch. 17 §03: support code for motivating `Pin`
chriskrycho Jun 13, 2024
686b3e4
Ch. 17 §03: add a TODO for checking Pin description correctness
chriskrycho Jun 13, 2024
91565da
Ch. 17 §03: correct listings and wording for `Pin` materials
chriskrycho Jun 13, 2024
fb683c9
Ch. 17 §03: correct listings and wording for first half of section
chriskrycho Jun 13, 2024
9d8f2c5
Ch. 17: renumber listings to eliminate `no-listing` listings
chriskrycho Jun 14, 2024
4f93e8b
Ch. 17: finish listing numbers for §04
chriskrycho Jun 14, 2024
d73e893
Merge `main` into `only-new-async`
chriskrycho Jun 14, 2024
4598e2c
Ch. 17 §01: make the conclusion section coherent
chriskrycho Jun 14, 2024
c0c24e2
Ch. 17 §02: transition for §03 and TODO cleanup
chriskrycho Jun 17, 2024
74df84e
Ch. 17: Add a new §05 on Stream and AsyncIterator
chriskrycho Jun 17, 2024
f0825ad
Ch. 17 S§02: introduce and explain `while let` syntax.
chriskrycho Jun 17, 2024
a05c34e
Ch. 17 §05: Introduce `Stream` and drop `AsyncIterator`
chriskrycho Jun 17, 2024
ad360d7
Ch 17. §01: leave a TODO about `IntoFuture`
chriskrycho Jun 18, 2024
52c516c
Ch. 17 §05: start explaining how we work with streams
chriskrycho Jun 18, 2024
e3ab302
Ch. 17: Remove a now-properly-numbered listing
chriskrycho Jun 19, 2024
cd1a3f7
Merge `main` into `only-new-async`
chriskrycho Jun 20, 2024
bf5e4aa
Ch. 17 (infra): add a base listing to use when generating new ones
chriskrycho Jun 19, 2024
e790c2c
Ch. 17: re-export `Stream`, `StreamExt`, and `stream_iter` in `trpl`
chriskrycho Jun 19, 2024
ce9b286
Ch. 17 §05: describe how to use `Stream`s with `Iterator`s
chriskrycho Jun 20, 2024
b4f5763
Ch. 17: final example for §05, with more re-exported streams
chriskrycho Jun 24, 2024
e71b667
Ch. 17 §05: First part of final example, with `ReceiverStream`
chriskrycho Jun 20, 2024
3c6c32c
Ch. 17 §05: complete example with `throttle` and `take`
chriskrycho Jun 25, 2024
bea8557
Ch. 17 §06: Start discussing future/task/thread tradeoffs
chriskrycho Jun 25, 2024
a8fe2d6
Merge `main` into `only-new-async`
chriskrycho Jun 26, 2024
bdd8f3e
Ch. 17 §06: more on tasks and threads, better example
chriskrycho Jun 26, 2024
ffb2d1b
Ch. 17: Most of §06 drafted, needs a conclusion
chriskrycho Jun 26, 2024
63214c3
Ch. 17 §00: rewrite the parallelism and concurrency section
chriskrycho Jun 26, 2024
6914bc4
Ch. 17 §00: no more cooks!
chriskrycho Jun 26, 2024
e774613
Ch. 17: remove 'base' listing
chriskrycho Jul 1, 2024
f039ca3
Ch. 17: Transition materials from Ch. 16 and into Ch. 18
chriskrycho Jun 27, 2024
5fdd92c
Ch. 17§00 initial edits
chriskrycho Jul 1, 2024
f023032
Ch. 17: add some more explanatory comments to `trpl`
chriskrycho Jul 1, 2024
eec1745
Ch. 17§01 initial edits for the first subsection
chriskrycho Jul 1, 2024
e238342
Ch. 17§01 initial edits for the second subsection
chriskrycho Jul 2, 2024
09b80f9
Ch. 17§02 initial edits on 'Counting'
chriskrycho Jul 2, 2024
e5c9afd
Ch. 17§02 initial edits on 'Message Passing'
chriskrycho Jul 2, 2024
89920d5
Ch. 17§03 Initial edits on opening section
chriskrycho Jul 3, 2024
451f77b
Ch. 17§03 initial edits on pinning section
chriskrycho Jul 3, 2024
1cc4dbe
Ch. 17§03: Rename the section for clarity
chriskrycho Jul 5, 2024
cc0f913
Ch. 17: remove now unused Listing 17-24
chriskrycho Jul 5, 2024
1030015
Ch. 17§04 initial edits on intro and “Yielding” section
chriskrycho Jul 5, 2024
ef1ed96
Ch. 17§04 initial edits on Building Our Own Async Abstractions
chriskrycho Jul 8, 2024
074c442
Ch. 17§05 initial edits on first two sections
chriskrycho Jul 9, 2024
1a90722
Merge `main` into `async-edits`
chriskrycho Jul 11, 2024
fbcdb24
Ch. 17§05 initial edits on 'Composing Streams'
chriskrycho Jul 11, 2024
2797d95
Ch. 17§05 initial edits on 'Merging Streams'
chriskrycho Jul 11, 2024
92c19ce
Ch. 17§06 initial edits
chriskrycho Jul 12, 2024
c3c88e4
Ch. 17 §03: restore accidentally-removed Listing 17-14
chriskrycho Jul 15, 2024
22b04c1
infra: prepare `trpl` crate for 0.1.0 release
chriskrycho Jul 16, 2024
58fff3c
Ch. 17§03: fix typo
chriskrycho Jul 16, 2024
130e6d0
Ch. 17: correct wrapping for a `Note`
chriskrycho Jul 16, 2024
dc8d7e8
Merge `main` into `async-edits`
chriskrycho Jul 17, 2024
bb9cdbb
Ch. 17: Update CI config to support testing the book with `trpl`
chriskrycho Jul 17, 2024
24ed6e4
Ch. 17§01: Make code/listings pass tests
chriskrycho Jul 17, 2024
deefe4d
Ch. 17§02: Make code/listings pass tests
chriskrycho Jul 17, 2024
6a0d072
Ch. 17§03: Make code/listings pass tests
chriskrycho Jul 17, 2024
0aacb80
Ch. 17§04: Make code/listings pass tests
chriskrycho Jul 17, 2024
40bdda7
Ch. 17§05: Make code/listings pass tests
chriskrycho Jul 17, 2024
5099e5f
Ch. 17§06: Make code listing pass tests and add a caption
chriskrycho Jul 17, 2024
45f1635
Ch. 17: fix spelling issues
chriskrycho Jul 22, 2024
463b819
Ch. 17: fix internal links with new ch. order
chriskrycho Jul 22, 2024
79fd5e2
Merge `main` into `async-edits`
chriskrycho Jul 22, 2024
644dbab
Ch. 17: fix an internal link reference
chriskrycho Jul 22, 2024
b2a2133
Merge `main` into `async-edits`
chriskrycho Jul 22, 2024
e669250
Ch. 17§00: phrasing/wording-level improvements
chriskrycho Jul 23, 2024
133bb61
Ch. 17§00: phrasing/wording-level improvements
chriskrycho Jul 23, 2024
4044534
Ch. 16: avoid slightly-dismissive language in transition
chriskrycho Jul 24, 2024
eb41efb
Ch. 17§00: rework the introduction based on initial reviews
chriskrycho Jul 24, 2024
cfaf187
Ch. 17: diagrams for concurrent and parallel execution
chriskrycho Jul 25, 2024
472f152
Ch. 17: fix diagrams and embed them in the text
chriskrycho Jul 26, 2024
fb718b3
Merge `main` into `async-edits`
chriskrycho Jul 31, 2024
ddad349
Merge `async-edits` into `only-new-async`
chriskrycho Aug 5, 2024
a42f27b
Ch. 17: Fix up diagrams
chriskrycho Aug 24, 2024
f812ed0
Ch. 17§00: second round of edits
chriskrycho Aug 24, 2024
1de14c8
Ch. 17: start restructuring chapter
chriskrycho Aug 24, 2024
c552952
Ch. 17: rename `trpl::block_on` to `trpl::run`
chriskrycho Aug 24, 2024
cd12a1e
Ch. 17: more edits for first three sections
chriskrycho Sep 10, 2024
487c81d
Merge `main` into `async-edits` (Rust 1.81 update)
chriskrycho Sep 11, 2024
9b13b95
Upgrade Ch. 17 listings for Rust 1.81
chriskrycho Sep 10, 2024
3cfdf2d
Ch. 17: rework 17.03 (and overall structure) from my own analysis
chriskrycho Sep 10, 2024
97902d5
Ch. 17: rework 17.04 with my own edits and analysis
chriskrycho Sep 11, 2024
68049c6
Ch. 17: rework 17.05 with my own edits and analysis
chriskrycho Sep 11, 2024
0d8da8b
Ch. 17: fold together 17.03 and 17.04
chriskrycho Sep 11, 2024
7da825f
Ch. 17: Make the new 17.05 actually work as a deep dive!
chriskrycho Sep 11, 2024
6bdf1b7
Merge `main` into `async-edits`
chriskrycho Sep 12, 2024
1d3517c
Ch. 17: integrate a number of the outstanding review comments
chriskrycho Sep 11, 2024
c4d02bf
Ch. 17: address the rest of James’ review comments 🎉
chriskrycho Sep 12, 2024
c35b7d9
Ch. 17: address most of the rest of Carol's outstanding comments
chriskrycho Sep 12, 2024
453247c
Ch. 17: address Tim and Carol's outstanding comments
chriskrycho Sep 13, 2024
ccafd06
Ch. 17: Fix some typos!
chriskrycho Sep 13, 2024
6f5773e
Remove duplicate integration test from root
chriskrycho Sep 16, 2024
cc5db97
Ch. 17: rewrite 17.01 with a better example
chriskrycho Sep 13, 2024
573a6ca
Ch. 17: fix mdbook test output
chriskrycho Sep 20, 2024
b265249
Ch. 17: Fix spelling and internal links
chriskrycho Sep 23, 2024
25ca8a1
Merge `async-edits` into `only-new-async`
chriskrycho Sep 23, 2024
42b5963
Ch. 17: General cleanup and edits to esp. 17.05
chriskrycho Sep 23, 2024
beac73a
Ch. 17: introduce diagrams for `Pin` and `Unpin`.
chriskrycho Sep 23, 2024
0388426
Ch. 17: Fix no-listing code for state machine enum
chriskrycho Sep 25, 2024
75ec154
infra: publish trpl@0.2.0 w/new features from edits
chriskrycho Sep 25, 2024
7f2d814
Merge `main` into `async-chapter`
chriskrycho Sep 27, 2024
aca71b6
Ch. 17: correct a missing word
chriskrycho Oct 1, 2024
8df8d8e
Be more explicit about creating a new project
carols10cents Oct 1, 2024
e8e0c6b
Introduce the listing more explicitly
carols10cents Oct 1, 2024
f727627
There is no name argument, but there is a url parameter
carols10cents Oct 1, 2024
a37e1a7
Rust not allowing main to be async isn't due to the first part of the…
carols10cents Oct 1, 2024
2f8e266
Clarify which reason we're talking about and what Rust programs have …
carols10cents Oct 1, 2024
e4e5a4b
We haven't added 2 calls yet; remove some text that's jumping ahead
carols10cents Oct 1, 2024
9fca5aa
Add a bit more detail about why we'd want a state machine enum
carols10cents Oct 1, 2024
01f089a
Clarify writing what would be tedious, and what changes later would b…
carols10cents Oct 1, 2024
502adbf
Be clearer about where we're using trpl::run and what it's running
carols10cents Oct 1, 2024
9ad373f
Correct function name and pronoun number
carols10cents Oct 1, 2024
a25f576
This sounds like 1 call with 2 URLs but it's 2 calls with 1 URL each
carols10cents Oct 1, 2024
15f353c
Add a trailing comma on the last variant
carols10cents Oct 1, 2024
d34446d
Correct another instance of an old function name
carols10cents Oct 1, 2024
f713c79
Put back the invitation to race URLs at the end
carols10cents Oct 1, 2024
78679a7
Clarify why the block only borrows and remove an unneeded word
carols10cents Oct 1, 2024
f01527c
Since -> because because none of these are time-based
carols10cents Oct 1, 2024
c2c083c
Removing code style around futures; not sure what this refers to
carols10cents Oct 1, 2024
63e7ab1
Oh I see, it's the futures variable, but then I wouldn't call it a tr…
carols10cents Oct 1, 2024
db93cd0
Caveat specificity of recv earlier, so we don't get WELL ACTUALLY pol…
carols10cents Oct 1, 2024
a97d72a
Change future tense to past tense or whatever these tenses are
carols10cents Oct 1, 2024
048717a
Missing period
carols10cents Oct 1, 2024
b3aef45
Stream is a trait
carols10cents Oct 1, 2024
428d6de
like -> similar to
carols10cents Oct 1, 2024
6cd340c
'All we need to do' makes it sound easy, but it might not be
carols10cents Oct 1, 2024
cec24f5
Be more specific than things
carols10cents Oct 1, 2024
79c2110
Say more about why we're building a stream instead of WebSockets
carols10cents Oct 1, 2024
9070b7f
Add an explicit definition of poll so we can use it later
carols10cents Oct 1, 2024
7aa0f88
Add a quick explanation of the semantics of merge
carols10cents Oct 1, 2024
ff5f487
Remove an extra 'with'
carols10cents Oct 1, 2024
796e534
Correct subj/verb agreement and remove a 'simply'
carols10cents Oct 1, 2024
48379d3
Update code and output to match text
carols10cents Oct 1, 2024
4647c8b
Add trailing comma
carols10cents Oct 2, 2024
afe43ca
Use contractions more; a few tiny fixes
carols10cents Oct 2, 2024
84eab32
Be more specific about 'them'
carols10cents Oct 3, 2024
13e7c88
Clarify where the commonly used Stream definition comes from
carols10cents Oct 3, 2024
9572827
Minimize the word 'like' when other words would fit
carols10cents Oct 3, 2024
fa97cab
Change nostarch snapshot chapter numbers to make room for the async c…
carols10cents Oct 4, 2024
3b8d132
Generated nostarch snapshot for the new async chapter
carols10cents Oct 4, 2024
daccf5e
Manual changes to the async chapter snapshot
carols10cents Oct 4, 2024
db949d6
Ch. 17: Remove TODO about `Stream` stabilization
chriskrycho Oct 7, 2024
c1d60d0
Ch. 17: some alternative wordings for “like” substitutions
chriskrycho Oct 7, 2024
06a3a71
Merge `main` into `async-chapter`
chriskrycho Oct 7, 2024
8f63245
Ch. 17: fix task names in Figure 17-2
chriskrycho Oct 7, 2024
3111eda
Ch. 17: create a diagram showing blocked parallelism
chriskrycho Oct 7, 2024
a64884f
Ch. 17: kill a double-“thus”
chriskrycho Oct 7, 2024
8aee93d
Ch. 17: include `main` when first showing `trpl::run`
chriskrycho Oct 7, 2024
f45980a
Ch. 17: get rid of some extra italics
chriskrycho Oct 7, 2024
7076be0
Ch. 17: improve the discussion of streams
chriskrycho Oct 8, 2024
3b920cd
Ch. 17: tweaks and fixes for discussion of the traits
chriskrycho Oct 8, 2024
1af831a
Ch. 17: Fix a lot of wording issues in the conclusion section
chriskrycho Oct 8, 2024
887694b
Ch. 17: update all the listing lock files
chriskrycho Oct 8, 2024
fb0215d
Ch. 17: Listings for Ch. 20 -> Ch. 21
chriskrycho Sep 26, 2024
82f91e7
Ch. 17: Listings for Ch. 19 -> Ch. 20
chriskrycho Sep 26, 2024
1f6ce67
Ch. 17: Listings for Ch. 18 -> Ch. 19
chriskrycho Sep 26, 2024
c8f4464
Ch. 17: Listings for old Ch. 17 -> Ch. 18
chriskrycho Sep 26, 2024
1fb74c3
Ch. 17: update all other text references for new ordering
chriskrycho Sep 26, 2024
54c567b
Ch. 17: update all internal links for new ordering
chriskrycho Sep 26, 2024
809b24a
Fix another listing number
chriskrycho Oct 3, 2024
fc62e40
Fix one more listing number
chriskrycho Oct 8, 2024
859c4e0
Merge pull request #4042 from rust-lang/async-chapter-with-listings
chriskrycho Oct 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,19 @@ jobs:
rustup --version
rustc -Vv
mdbook --version

# mdBook does not currently have particularly good support for “external”
# crates. To make the test suite work correctly with `trpl`, we must first
# build `trpl` itself (`mdbook` will not do it), and then explicitly pass
# its `deps` path as a library search path for `mdbook test`. That will make
# sure all the crates can be resolved when running the tests.
- name: Build `trpl` crate
run: |
cd packages/trpl
cargo build
- name: Run tests
run: mdbook test
run:
mdbook test --library-path packages/trpl/target/debug/deps
package_tests:
name: Run package tests
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions 2018-edition/src/ch17-03-oo-design-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

If you came here via a link or web search, you may want to check out [the current
version of the book](../ch17-03-oo-design-patterns.html) instead.
version of the book](../ch18-03-oo-design-patterns.html) instead.

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-03-oo-design-patterns.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-03-oo-design-patterns.html).
36 changes: 18 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ exclude = [
"linkchecker", # linkchecker is part of the CI workflow
"listings", # these are intentionally distinct from the workspace
"tmp", # listings are built here when updating output via tools/update-rustc.sh
"packages/trpl", # manages its own dependencies as a standalone crate

# These are used as path dependencies in `rust-lang/rust` (since we are not
# publishing them to crates.io), so they cannot be part of this workspace,
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ $ start chrome.exe .\book\index.html # Windows (Cmd)
To run the tests:

```bash
$ mdbook test
$ cd packages/trpl
$ mdbook test --library-path packages/trpl/target/debug/deps
```

## Contributing
Expand Down
30 changes: 30 additions & 0 deletions ci/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ bool
boolean
Boolean
Booleans
booleans
Bors
BorrowMutError
BoxMeUp
Expand Down Expand Up @@ -109,6 +110,7 @@ deallocate
deallocated
deallocating
deallocation
debounce
debuginfo
decl
decrementing
Expand Down Expand Up @@ -145,10 +147,12 @@ DisplayBacktrace
DivAssign
DraftPost
DSTs
durations
ebook
ebooks
Edsger
egular
ElementRef
else's
emoji
encodings
Expand Down Expand Up @@ -179,6 +183,7 @@ filesystem's
filesystems
filmmaking
Firefox
FirstAwaitPoint
FnMut
FnOnce
formatter
Expand All @@ -187,6 +192,8 @@ FrenchToast
FromIterator
FromResidual
frontend
FuturesUnordered
GetAwaitPoint
getrandom
getter
getters
Expand All @@ -197,6 +204,7 @@ grapheme
Grapheme
growable
gzip
handoff
hardcode
hardcoded
hardcoding
Expand Down Expand Up @@ -241,7 +249,9 @@ inline
instantiation
internet
interoperate
IntoFuture
IntoIterator
intra
InvalidDigit
invariants
ioerror
Expand All @@ -256,6 +266,7 @@ isize
iter
iterator's
JavaScript
JoinAll
JoinHandle
Kay's
kinded
Expand Down Expand Up @@ -288,12 +299,15 @@ lval
macOS
Matsakis
mathematic
mdbook
memoization
metadata
Metadata
metaprogramming
mibbit
Mibbit
microcontroller
microcontrollers
millis
minigrep
mixup
Expand All @@ -307,17 +321,20 @@ monomorphized
MoveMessage
Mozilla
mpsc
MSRV
msvc
MulAssign
multibyte
multithreaded
multithreading
mutex
mutex's
Mutex
mutexes
Mutexes
MutexGuard
mutext
MyAsyncStateMachine
MyBox
myprogram
namespace
Expand Down Expand Up @@ -358,7 +375,9 @@ OurError
OutlinePrint
overloadable
overread
PageTitleFuture
PanicPayload
parallelizable
param
parameterize
ParseIntError
Expand All @@ -371,6 +390,7 @@ PlaceholderType
polymorphism
PoolCreationError
portia
postfix
powershell
PowerShell
powi
Expand All @@ -396,6 +416,8 @@ RangeTo
RangeFull
README
READMEs
ReadFinished
ReceiverStream
rect
recurse
recv
Expand Down Expand Up @@ -438,6 +460,7 @@ sampleproject
screenshot
searchstring
SecondaryColor
SecondAwaitPoint
SelectBox
semver
SemVer
Expand All @@ -455,6 +478,7 @@ SliceIndex
Smalltalk
snuck
someproject
SomeType
someusername
SPDX
spdx
Expand All @@ -470,6 +494,7 @@ stdlib
stdout
steveklabnik's
stringify
StreamExt
Stroustrup
Stroustrup's
struct
Expand Down Expand Up @@ -502,6 +527,7 @@ TcpListener
TcpStream
templating
test's
TextAwaitPoint
TextField
That'd
there'd
Expand All @@ -514,6 +540,8 @@ tlborm
tlsv
TODO
TokenStream
Tokio
tokio
toml
TOML
toolchain
Expand All @@ -538,6 +566,7 @@ uncomment
Uncomment
uncommenting
unevaluated
unhandled
Uninstalling
uninstall
unittests
Expand All @@ -556,6 +585,7 @@ username
USERPROFILE
usize
UsState
util
utils
vals
variable's
Expand Down
41 changes: 41 additions & 0 deletions dot/trpl17-01.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
digraph {
dpi = 300.0;

rankdir = "LR";

// makes ordering between subgraphs work
newrank = true;

node [shape = diamond;];

subgraph cluster_task_a {
label = "Task A";

A1;
A2;
A3;
A4;

A1 -> A2 -> A3 -> A4 -> A0 [style = invis;];

// for vertical alignment purposes only
A0 [style = invis;];

// Makes the heights line up between the boxes.
A4 -> A0 [style = invis;];
}

subgraph cluster_task_b {
label = "Task B";

B0 [style = invis;];

B1;
B2;
B3;

B0 -> B1 -> B2 -> B3 [style = invis;];
}

A1 -> B1 -> A2 -> B2 -> A3 -> A4 -> B3;
}
25 changes: 25 additions & 0 deletions dot/trpl17-02.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
digraph {
dpi = 300.0;

rankdir = "LR";
splines = false;
cluster = true;

node [shape = diamond;];

// The graphs end up with the correct order, i.e. Task 1 *above* Task 2, when
// this is first.
subgraph cluster_ColleagueB {
label = "Task 2";
B1 -> B2 -> B3;

B0 [style = invis;];
B3 -> B0 [style = invis;]
}

subgraph cluster_ColleagueA {
newrank = true;
label = "Task 1";
A1 -> A2 -> A3 -> A4;
}
}
Loading