9
Lifetimes
An important promise from Rust to developers is memory safeness, which is enforced within the ownership model. Ownership and borrowing are two of the three pillars in the ownership model. Lifetimes is the final pillar to complete our conversation about the subject. Despite this laudable goal, there is a general misunderstanding of lifetimes within the Rust community. Most Rust developers are satisfied knowing just enough about lifetimes to prevent the borrow checker from complaining. The objective of this chapter is to provide clarity on this important topic. Lifetimes should be a benefit, not something to ignore.
Lifetimes is another unique feature within the Rust language. Other languages, such as C, C++, and Java, do not have ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access