The Rust Application Lifetime

Rust, as we have seen, is a very stable language. It is also what can be described as a memory-safe language in that, when the code is compiling, the compiler tests the code to ensure that things don't go wrong, such as accessing outside of an array or freeing memory twice.

This is purely down to Rust obeying three key rules—ownership, references (or borrowing, as it's more commonly known), and the application lifetime.

In this chapter, we will discuss and see how the three key facets work to ensure that your Rust application always behaves itself. They are as follows:

  • Ownership
  • Borrowing
  • Lifetime
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset