The Rust Programming Language

rw-book-cover

Metadata

Highlights

  • Lifetime annotations don’t change how long any of the references live. Rather, they describe the relationships of the lifetimes of multiple references to each other without affecting the lifetimes (View Highlight)
  • One special lifetime we need to discuss is 'static, which denotes that the affected reference can live for the entire duration of the program. (View Highlight)
  • Because lifetimes are a type of generic, the declarations of the lifetime parameter 'a and the generic type parameter T go in the same list inside the angle brackets after the function name. (View Highlight)