Lifetimes in Rust
One of the (or maybe just The ) coolest part of #Rust is the concept of Lifetimes — the scope for which a reference in Rust is valid. Or, to put it differently think of a “Lifetime” as the range between when any data is introduced into a program (“initialization”), and and when it is removed (“dropped”). (•) You’re probably thinking “garbage collection”, and you wouldn’t be entirely wrong. OTOH, you wouldn’t be right either — Lifetimes are embedded deep into Rust (e.g., they are part of function signatures, references are annotated with their lifetimes, etc.). Think of this as the compiler actively validating all uses of the data before you even run the program, and ensuring that whenever data is “borrowed” it can’t live longer than the reference it is borrowed from For an excellent description of lifetimes, take a look at Florian’s writeup at https://goo.gl/A7crBV , and then read up on the — very clear! — documentation at https://goo.gl/...