Skip to content

Pinning chapter #253

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

Merged
merged 1 commit into from
Jun 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion book.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[book]
title = "Asynchronous Programming in Rust"
authors = ["Taylor Cramer"]
authors = ["Taylor Cramer", "Nicholas Cameron", "Open source contributors"]

[build]
create-missing = false
Expand All @@ -12,3 +12,4 @@ site-url = "/async-book/"
[output.linkcheck]
follow-web-links = true
traverse-parent-directories = false
exclude = [ 'blog\.cloudflare\.com' ]
6 changes: 2 additions & 4 deletions src/02_execution/02_future.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ real `Future` trait and how it is different.
```

The first change you'll notice is that our `self` type is no longer `&mut Self`,
but has changed to `Pin<&mut Self>`. We'll talk more about pinning in [a later
section][pinning], but for now know that it allows us to create futures that
but has changed to `Pin<&mut Self>`. We'll talk more about pinning in a later
section, but for now know that it allows us to create futures that
are immovable. Immovable objects can store pointers between their fields,
e.g. `struct MyFut { a: i32, ptr_to_a: *const i32 }`. Pinning is necessary
to enable async/await.
Expand All @@ -76,5 +76,3 @@ In a real-world scenario, a complex application like a web server may have
thousands of different connections whose wakeups should all be
managed separately. The `Context` type solves this by providing access to
a value of type `Waker`, which can be used to wake up a specific task.

[pinning]: ../04_pinning/01_chapter.md
Loading