Skip to content

Commit

Permalink
Ch. 17.01 (NoStarch Edits): standardize ‘stream’ and Stream usage
Browse files Browse the repository at this point in the history
Happily, I was *much* more consistent on this. Curious!
  • Loading branch information
chriskrycho committed Jan 17, 2025
1 parent 889ad9a commit c612c07
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/ch17-04-streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,14 @@ so far, you might reasonably expect that trait to be `Stream`, but it’s actual
`StreamExt`. Short for _extension_, `Ext` is a common pattern in the
Rust community for extending one trait with another.

We’ll explain the Stream and StreamExt traits in a bit more detail at the end of
the chapter, but for now all you need to know is that the `Stream` trait defines
a low-level interface that effectively combines the `Iterator` and `Future`
traits. `StreamExt` supplies a higher-level set of APIs on top of `Stream`,
including the `next` method as well as other utility methods similar to those
provided by the `Iterator` trait. `Stream` and `StreamExt` are not yet part of
Rust’s standard library, but most ecosystem crates use the same definition.
We’ll explain the `Stream` and `StreamExt` traits in a bit more detail at the
end of the chapter, but for now all you need to know is that the `Stream` trait
defines a low-level interface that effectively combines the `Iterator` and
`Future` traits. `StreamExt` supplies a higher-level set of APIs on top of
`Stream`, including the `next` method as well as other utility methods similar
to those provided by the `Iterator` trait. `Stream` and `StreamExt` are not yet
part of Rust’s standard library, but most ecosystem crates use the same
definition.

The fix to the compiler error is to add a `use` statement for `trpl::StreamExt`,
as in Listing 17-31.
Expand Down
2 changes: 1 addition & 1 deletion src/ch17-05-traits-for-async.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ idea of how to fix your code!
> see Chapters [2][under-the-hood] and [4][pinning] of [_Asynchronous
> Programming in Rust_][async-book].
### The Stream Trait
### The `Stream` Trait

Now that you have a deeper grasp on the `Future`, `Pin`, and `Unpin` traits, we
can turn our attention to the `Stream` trait. As you learned earlier in the
Expand Down

0 comments on commit c612c07

Please sign in to comment.