Book Image

Learn Rust in 7 Days [Video]

By : Matthew Stoodley
Book Image

Learn Rust in 7 Days [Video]

By: Matthew Stoodley

Overview of this book

The Rust programming language makes it possible to build fast reliable code, prevents segfaults, and guarantees memory safety, even while working across concurrent processes. The course is split into seven parts, which give you a complete overview of why Rust is a great programming language. In the first couple of days, you’ll learn to install Rust on your system, discover its syntax, and see a library that utilizes the feature of trait-based generics and code reusability. On days 3 and 4, you’ll understand how Rust Lifetimes work by doing extensive compiler checking and learn to make your programs more interactive by accessing all the bits of the Rust environment. On day 5, you’ll learn about multithreading without data races with safe concurrency. Day 6, you’ll create a database, using your code to read and update while securing it with Bcrypt from various breaches such as SQL injection attacks. By the end of the course, you’ll have built a mini-bank application that tracks users’ financial transactions over time, allowing them to view their history over time. All the code and supporting files for this course are available on Github at https://github.com/PacktPublishing/-Learn-Rust-in-7-Days
Table of Contents (7 chapters)
Chapter 3
Lifetimes
Content Locked
Section 2
Passing a Borrow Forward
In rust you can pss data around by copying it, or by pointing to it. We need to understand when to do each - Show how we can borrowing an object means we can call functions without losing the data - Show how we can change things we are pointing to - Show how the compiler protects us from mutating data that is currently borrowed elsewhere