~/talk

The Mystery of the Pin

Talkat RustNL 2023 · on Wednesday, 2023-05-10· [rust]
slides:none on file

Explains why Pin stops moves by blocking access to the pointers or mutable references needed for a mem copy, shows how self‑referential structs break naive moves, and demonstrates wrapping a TcpStream with metrics to reveal the generic-T problem. Uses mem::swap, the Unpin auto‑trait, and the pin_project / pin_project_lite macro to generate safe field projection. Notes that async futures are !Unpin, that most types are Unpin so Pin is usually a no‑op, and that mem::swap and pin_project let the wrapper work while pin_project_light forbids implementing Drop (pin_project supports PinDrop).

AI-written summary · about

  1. 0:00Start
  2. 2:03MOVE BY "MEMCPY"
  3. 2:47MOVE SEMANTICS
  4. 3:57MOVING POINTERS
  5. 4:28SNEAKY MOVE
  6. 5:46SELF-REFERENTIAL STRUCT
  7. 6:49ASYNC BLOCKS & FUNCTIONS
  8. 9:05PIN IS FOR POINTERS
  9. 12:46IN SHORT
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.