• Rust Patterns (Lars Bergstrom)
  • Goals (slide 1)
  • 2
  • owned pointer example (slide 3)
  • Linked list (slide 4)
  • Simple linked list with header (slide 5)
  • quiz: why can't it be
  • Type has infinite size
  • First wrong attempt
  • Where it goes bad
  • Instead: use unsafe pointers
  • wrapping up the access in Rawlink
  • Just like Option, but unsafe
  • New push_front code
  • Use by converting to an Option
  • What happens if...
  • Boom...
  • Raw pointers
  • How does Servo use this?
  • Questions
  • Part 2: Phantom types
  • Why not just priv?
  • Pull out the secure methods
  • Transmute to get access
  • How does Servo use this?