Skip to content

Commit

Permalink
Ch. 17 §05: describe how to use Streams with Iterators
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chriskrycho committed Jun 20, 2024
1 parent e790c2c commit ce9b286
Show file tree
Hide file tree
Showing 17 changed files with 1,707 additions and 4 deletions.
292 changes: 292 additions & 0 deletions listings/ch17-async-await/listing-17-36/Cargo.lock

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

8 changes: 8 additions & 0 deletions listings/ch17-async-await/listing-17-36/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "async_await"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
trpl = { path = "../../../packages/trpl" }
8 changes: 8 additions & 0 deletions listings/ch17-async-await/listing-17-36/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fn main() {
trpl::block_on(async {
// ANCHOR: range
let values = 1..101;
let iter = values.map(|n| n * 2);
// ANCHOR_END: range
});
}
Loading

0 comments on commit ce9b286

Please sign in to comment.