- Reintroduce accidentally-dropped content. I meant to simply carry this
over in 74df84ea, but failed to, perhaps because I had `mdbook serve`
running and it tries to be helpful about generating files which are
referenced in `SUMMARY.md` but do not exist on disk. Either way, this
is back now and we can use it to explain these concepts.
- Start on an example showing how `thread::spawn` and `spawn_task` are
basically interchangeable from an API POV, so that we can then see how
they differ in terms of runtime consequences.
Use `IntervalStream` and `ReceiverStream` to show the composition of
multiple streams, along with throttling and timeouts. This will also
provide a useful foundation for discussing the relationships between
futures, tasks, and threads in the final sections of the book, since
you can accomplish the same basic API by simply substituting threads
for tasks—but with different tradeoffs!
Also start laying the foundation for (a) showing how that interacts with
previous material, e.g. around slow operations; and (b) showing how it
composes nicely with other async operations, e.g. timeouts, throttling,
and (maybe!) even merging streams.
This is actually the first time it appears in the book, to my great
surprise! We will also need to update Chapter 19 to account for having
introduced this form already, following the example for how it handles
Chapter 6’s introduction of `if let`.
- Rexport `tokio::fs::read_to_string` as `trpl::read_to_string`.
- Add a no-listing example for the mutable borrow example. This will
keep us honest that the code there itself compiles just fine!
This one may or may not make sense: the output *order* should be the
same regardless, but there will be a *lot* of extra noise in it because
of the `cargo build` output before the actual program output, and we do
not appear to have a good way to focus on particular subsets of output
the way we do for code?