mirror of https://github.com/rust-lang/async-book
Applied suggestion
This commit is contained in:
parent
07364d325b
commit
6dd9ce4199
|
@ -313,8 +313,9 @@ It's easy to get this to show undefined behavior and fail in other spectacular w
|
|||
Let's see how pinning and the `Pin` type can help us solve this problem.
|
||||
|
||||
The `Pin` type wraps pointer types, guaranteeing that the values behind the
|
||||
pointer won't be moved. For example, `Pin<&mut T>`, `Pin<&T>`,
|
||||
`Pin<Box<T>>` all guarantee that `T` won't be moved if `T: !Unpin`.
|
||||
pointer won't be moved if it is not implementing `Unpin`. For example, `Pin<&mut
|
||||
T>`, `Pin<&T>`, `Pin<Box<T>>` all guarantee that `T` won't be moved if `T:
|
||||
!Unpin`.
|
||||
|
||||
Most types don't have a problem being moved. These types implement a trait
|
||||
called `Unpin`. Pointers to `Unpin` types can be freely placed into or taken
|
||||
|
|
Loading…
Reference in New Issue