Description
Course info
Rating
(66)
Level
Beginner
Updated
May 27, 2016
Duration
4h 37m
Description

In this course, Rust Fundamentals, you will be introduced to Rust, a native code programming language. First, you'll see all the syntax and the specifics of the language. Next, you'll be introduced to the fundamental Rust data types and their use in declaration of variables. By the end of this course, you'll have a thorough understanding of Rust and its specific approach to the ideas of memory safety and explicit implementations of mutability, lifetime, and the concepts of sharing/borrowing data.

About the author
About the author

Dmitri is a developer, speaker, podcaster, technical evangelist and wannabe quant.

More from the author
ReSharper Fundamentals
Intermediate
2h 54m
Apr 28, 2017
More courses by Dmitri Nesteruk
Section Introduction Transcripts
Section Introduction Transcripts

Types and Variables
In this module we're going to talk about the fundamental data types that Rust supports and we'll also see how to declare variables. So what are we going to see in this module? Well first of all we'll talk about the fundamental data types with a focus on the numerics, although there's going to be Boolean data types in there as well. Then we'll talk about the operators which can actually operate upon data. Then we'll talk about the idea of scope and shadowing and we'll also see that Rust variables can actually be re-declared. Then we'll talk about how to declare constants and finally we'll discuss, this is going to be the theoretical part, we're going to discuss the ideas of storing variables either on the stack or on the heap.

Control Flow
In this module we're going to take a look at some of the control flow constructs that Rust supports. So what are we going to discuss? First of all, we'll take a look at the if statement, then we'll take a look at the looping constructs in Rust, which are while and loop, then we're going to talk about for loops and we're going to finish with the all powerful match statement.

Data Structures
In this module we're going to discuss the data structures that Rust supports. So what are we going to discuss? Well first of all, we'll talk about structs. Now structs are essentially groupings of different fields, which can be of different types, which make up your particular custom type. Then we're going to talk about enumerations, which is another way of building custom types, which are perhaps a bit more simple. Then we're going to take a look at the option T type and also the if let statement. And the reason we're discussing these is because option of T is a central feature of Rust for describing the optionality of something. Then we're going to talk about arrays and then we're going to talk about vectors, which behave kind of like arrays, but are a lot more flexible (Loading).

More Data Structures
In this module we're going to continue our discussion of Rust data structures and take a look at a few more things that you can do with them. So first of all, we're going to discuss slices. Now slices are an important idea for actually taking a slice out of an array or a vector, for example, and then passing it to some other function for processing. Then we're going to take a look at strings, and with regard to strings, Rust is a bit weird because it has two distinct string types and we're going to discuss what those are. Then we're going to talk about tuples and tuples basically let us just take a couple of distinct possibly different types of values and group them together and then pass them to a function or return from a function, for example, and we're going to take a look at the idea of destructuring tuples as well. Then we're going to take a look at pattern matching, we've already met the match statement, but in this module we're going to see the full power of what you can do with the match statement and pattern matching, and we're going to finish off the module with generics, which is this idea that when you create a type, you don't have to rigidly specify the types of its fields, instead you can specify them in a variable way so that you can later substitute a particular type in place of what the variable should be.

Functions
In this module we're going to discuss functions. So we're going to see just ordinary functions and how to pass arguments into those functions, then we're going to see functions which are actually attached to structs, and these are called methods, then we're going to talk about closures, that's essentially how do you create a function, if you're already inside a function and you just want a variable, which refers to a chunk of code that needs to be doing something, then we're going to talk about higher-order functions, that's the idea that you can take functions and you can pass them into other functions or you can return them from functions, and finally we're going to talk about traits.

Lifetime
In this module we're going to discuss the idea of lifetime, which is central to Rust, and there is just two concepts that we need to discuss. First of all we're going to discuss ownership, the idea that a variable which refers to some chunk of memory effectively owns this memory, and then we're going to take a look at borrowing, which is what happens when some other function, for example, wants to temporarily take over a variable for the purposes of using it for something, but then returns ownership back, and that's what's called borrowing.

Odds and Ends
In this module we're going to discuss some of the infrastructural solutions that Rust provides for managing dependencies and that sort of thing. So the kind of things we're going to cover are as follows, first of all, we'll take a look at how to consume external crates from crates. io, and then we'll talk about modules and how you can actually build your own crates and obviously consume your own crates as well. Then we're going to discuss the idea of unit testing and the fact that Rust actually comes with built in support for running tests and finally, we'll take a look at how to write comments and how to actually generate beautiful HTML documentation.