
This video will give you an overview about the course.
In this video, we will talk about what Rust is and what its significance is.
Learn about Rusts history
Understand what is Rust
This video will guide you through the installation of Rust on your computer.
Open the official download page for Rust
Run the “rustup” installation tool in your terminal
Check if Rust is installed successfully
This video introduces Rusts package manager Cargo.
Create a new project with Cargo
Inspect the Cargo.toml file in the project folder
Find external crates from crates.io website
In this video, we will write our first program in Rust.
Use Cargo to create a new project
Open the main.rs file in your text editor
Change the first line of code to print out "Hello, Rust"
This video explains what is immutability and variables in Rust.
Create a new project with Cargo
Make a new variable that is immutable
Make another variable that will be mutable
In this video, we will see which data types and operators we have in Rust.
Create a new project with Cargo
Create a couple of variables of different types
Test logical and mathematical operators
In this video, we will learn about the “if else” expression, and also what kinds of loops are there in Rust.
Create a new project with Cargo
Create a test program that will test if a variable meets a condition or not
Create samples to test the for loop and while loop
This video explains Rusts match operator.
Create a new project with Cargo
Write a simple program that tests the use case of the match operator
Run the example in the terminal with different parameters
In this video, we will learn about strings, vectors and arrays in Rust.
Basic operations and syntax for arrays
Declare a new string and the difference between strings and string literals
Create vectors with the new() method and with the vec macro
This video aims at explaining the basic principles of Rusts ownership system.
Create a new project with Cargo
Isolate a part of the code into a separate scope
Understand the importance of borrowing and references
In this video, we will learn how to write functions and how to separate them into modules.
Create a new project with Cargo
Write a multiplication function and multiplication_print_result function that will call the first one inside it
Separate a function into a module called some_module that is placed inside the some_module.rs Rust file in the source folder
This video will teach you about structured data and enumeration types.
Create a new project with Cargo
Create a new structure called User with a method called print_user()
Make an enum called user type that will be used inside the previous structure
This video aims at making a new crate and downloading external crates in your app.
Create a new project and a new crate inside that project with Cargo
Use the structure from the previous video inside the crate and include it in the main file
Download the regex crate from crates.io
In this video, we will use Cargo to test our functions.
Open the previous project
Write a test that will create a new User
Run the tests in the terminal with Cargo
In this video, we will explore the idea behind generic data types.
Use the crate from the previous section
Make a new structure called UserCollection
Add a generic type T for the size field in the structure
This video aims at explaining the concept of lifetimes in Rust.
Create a function with the lifetime of 'a'
Create a structure and its method with a specified lifetime
Understand the static lifetime
In this video, we will learn about creating and using traits in our application.
Create a trait called StrikeTrait
Implement the traits for two different structure methods
Test the methods in the main program
This video will teach you some basic concurrency principles such as multithreading.
Understand what data races, race conditions and threads are
Create two new threads and join them back to the main thread
Use thread::sleep() to tell the main thread to wait on the child threads
In this video, we will overview what we’ll need to make in this application.
Describe the program workflow
Define which modules and crates will we need in our application
Create a new project with Cargo
In this video, we will start implementing all the structures and methods in our app.
Create a separate module called structs that will contain all the structures
Implement the logic for the structures
Build and compile the project to check whether there’s any error
In this video, we will write our main logic inside a loop and we will test if our app works.
Write all the remaining methods and functions for our structs
Write the main logic of the app inside the main function
Test and run it with Cargo
This video will recap what we’ve made and explore further improvements to our program.
Explore different approaches to solve the same problem more efficiently
Understand the difference between a console application and a GUI application
Suggest game engines like Piston for making the application look better
This video will give you an overview about the course.
As RUST is a systems language, we need to know how to run RUST using console. In this video we‘ll get to know how RUST is compiled while running it using console.
Learn some of the basics of Cargo
Build a new project with RUST
Build a console application which tells our robot to do something
To be able to do more coding in Rust we first need to learn basic Rust syntaxes that will help us in developing interesting applications. Let's do just that in this video.
Learn what data types are
Get to know loops and conditional statements
Understand the difference between an expression and a statement
When we will build a real-life project that will contain a large amount of code for sure. To make that large amount of code readable and easily customizable we will need to modularize the code.
Know about Rust's Module System
Learn how to build modules
Learn how to implement Modules
Building each and every function and module by writing raw code gets a little overwhelming for a developer. Developers can get help in this point by using Rust's Standard Library.
To make our robot more functional and capable to do many other things, we need to use functions and modules from standard library.
Get an overview of Rust's Standard Library
Loading modules from the standard library
Use functions and module items
Rust's modules are managed, published, and retrieved by most important tool of rust tool chain – Cargo. To develop a more functional application, we have to add our additional libraries or local gits to this tool. Cargo tool is controlled by cargo.toml file. We need to know to how to add additional binaries, libraries and local gits with this file. Let's see how to do that in this video.
Take an overview of the Rust Tool Chain and Ecosystem
Explore ways to add additional binaries and libraries to the cargo.toml file
Add local gits with the cargo.toml file
The crates that we have built may depend on other libraries from crates.io or from gits or from other folders of your pc. To ensure properly functional crates, you have to manage their dependencies properly with the cargo.
Adopt knowledge of dependency in Cargo
Specify dependencies from crates.io
Specify dependencies from local path location
We need to make our robot more functional on specific tasks. To do this we need to use more crates. We can solve this problem by shopping on crates.io.
Take an overview of crates.io
Explore required crates on crates.io
Add dependencies of the specific crates that we want to use from crates.io
It is very important for a developer to know whether he is writing code perfectly or not or is there a bug in the code. The same applies for Rust programming. To solve this problem Rust gives extra facility to test our code. Let's check that out.
Know the testing process
Know the test attributes
Know the test directories
Keeping memory and reference different from each other in Rust is known as Borrow Checker. It also verifies concurrency safety. We should understand how rust does this job.
Understand the magnificent type system of Rust.
Get an overview of memory and reference and concurrency safety.
Know how Borrow Checker ensures verification of memory and concurrency safety.
Rust concurrency or parallelism is normally understood by sending and syncing of data. Where data sent is safe by default, but sync is not safe.
Understanding how rust handles this safety is our main focus point for this video.
Understand concurrency safety
Understand Borrow Checker
Know how safety is maintained though rust is a concurrent system
To control our army, we need to impose restriction on them. We can make this done by contracting which can be done by using Rust's trait system.
Know Rust's Trait system
Safe programming
Contract building
In case of distributed simulation, there are network protocols for this simulation. Pattern matching could be a powerful tool when we are building such network protocol. Rust offers a smart pattern matching mechanism. Let's see this.
Check out pattern matching
Use pattern matching in protocol programming
Trait is a very important feature of Rust. We can use it for many complex tasks. To do that we have to go deep in the trait system.
Take a look at the Trait System
Take a look at Advanced trait
Follow an example for better understanding
To make our system (robot) more functional, we need to communicate with it.
Take a look at concurrency
Learn about message passing (send message)
Develop a message sending system using the Rust API
As messages are sent and received through some shared states by the channels there is no guarantee that no unexpected sharing of states will occur. At this point, to protect accidental sharing of states as well as protect messages from unwanted leaking we need to use a Rust API – Lock.
Know why packing and unpacking is required
Know what is Lock and why we need it
Know functionality of Lock
One of the main and most important reasons for which the Rust invention project was initiated is to handle concurrency less painfully. And Rust as a programming language can handle this very smartly. Our target is now to know deeply the Rust's concurrency management system.
Concurrency and Threads
Learn Thread Safety and shared mutable states
Channel based communication
Since we are building a simulation, we'll also want a high degree of randomness to allow us to exercise the probability of gambits winning or losing.
Understand Rust Rand function and its functionality
Include rand package with our system
Implement Rand to our robot army
To make our system truly extensible, not only will our robots be separate implementations of traits, they'll live in separate modules. In order to advertise our army's capabilities, we'll have to document them thoroughly and make the documentation available online.
What is Commenting and its necessity
What is documenting and its necessity
How make documentation
In order to make the simulation easy to read, let's add a little color with a special rust crate.
Know the colored package
Know how to add up this with our project
Color up our project with colored package
We have already built a Robot army simulation system using Rust, but still this is bound in our consoles. Let's make it a Real-time simulation system which will help the clients to communicate through the web.
Learn about Rust's IO systems
Find the constraints of our previously used IO system
Find the solution with a different IO system
To make our simulation application a real time one, the first and most important challenge is to develop a system that will have a non-blocking IO system. Mio framework is the first step to this problem.
We will learn the basics of Mio Framework
We will develop an echo application with TCP communication which will be a non-blocking one
We will see how the application works through the network along with the OS
To make our army simulation application a real time live application we have do something awesome with the Mio and Hyper framework of Rust.
Earlier, we have learnt about Mio. Now its turn to Hyper.
We will know about Hyper
Features and syntaxes of Hyper
We will develop a website with Hyper
Fundamental operations and functions of Hyper are our next field of study.
We will learn about Hyper frameworks more deeply
Learn Hyper's Modules
Learn Hyper's Macros and Structs
So far, we have worked in the root level with very raw coding now we should cover those so that it looks well structured.
Prepare Handler
Make Handler Synchronized
Prepare a Request Response Pair
To make our server connected with the user we have to develop a protocol which can establish a connection to the user through TCP connection.
We will learn about Websocket
Understand TCP communication
Plugin websocket with our Hyper server
We have already developed a simulation application and on the other hand we have developed a High-performance networking system with Hyper Server which can establish HTTP communication. Now it's time to adapt the outputs of our existing simulation system with our HTTP server through websockets.
Connect simulator with websockets
Configure websockets to the server
Run the final simulation
This video gives an overview of the entire course.
In this video, we will look at the different layers of a network model and understand each one in detail.
We have seen why it is important to identify hosts and networks uniquely to be able to deliver packets reliably. Depending on the scale, there are three major ways of doing this; we will discuss each of those in this video.
Learn about Ethernet address and IP address
It is not possible for anyone to remember the IP address of each and every service. We have a protocol for that fortunately, DNS.
Look at how DNS works
For two hosts to communicate via a network, they will need to send messages to each other. There are two models of exchanging messages, and each has specific use cases where they work best.
Learn about connection-oriented service
Understand connectionless service
In this video, we will get started with the basics of Rust.
Put Cargo's bin directory to our PATH
Set up a Rust project and run it
The most important aspect of Rust is the ownership and borrowing model. Based on the strict enforcing of borrowing rules, the compiler can guarantee memory safety without an external garbage collector.
Declare variables using let keyword
Clone the resource named mystr using .clone()
Use the Rust compiler directly to compile our code
Rust supports writing generic code that is later bound with more concrete types, either during compile time or during runtime. We also introduce some new constructs which we haven't discussed before, which we will explain as we proceed.
Look at a naive implementation
Put the trait bound in the sum function
Define a generic trait of type T
One of Rust's major goals is enabling the developer to write robust software. An essential component of this is advanced error handling. In this video, we will take a deeper look at how Rust does error handling.
Return a special enum that carries the result
Expand on the standard error type and implement custom errors
Write our divide function
Rust supports a macro system that has evolved quite a lot over the years. A distinctive feature of Rust macros are that they are guaranteed to not refer to identifiers outside their scope by accident.
Look at syntactic macros
Look at procedural macros
Rust has rich support for functional programming both in the language and in the standard library. In this video, we will look at some of these.
Look at higher-order functions
Implement iterators
One of the promises of Rust is to enable fearless concurrency. Quite naturally, Rust has support for writing concurrent code through a number of mechanisms. In this video, we will discuss a few of these.
Look at how Rust enables writing multithreaded applications
Import the threading library
Create a variable and a pointer
Rust treats testing as a first-class construct; all tools in the ecosystem supports testing. The compiler provides a built-in configuration attribute that designates a module for testing.
Run cargo test
Add a test to make sure factorial actually works
Add some doctest for our factorial macro
In this video we will see how a simple multithreaded TCP client and server looks like in Rust.
Write basic echo server
Create a new TcpListener
Declare a dependency on the rand crate
In this video, we will see how a simple multithreaded UDP client and server looks like in Rust.
Bind the local address on a given port
Write a simple UDP client
Look at how multicasting works
In this video, we will look at number of functionalities in std::net.
Construct an IpAddr from a string and check it
Construct a globally routable IPv6 address from individual octet
Construct a SocketAddr from a string an assert that the underlying
Serde provides a few macros that can be implemented on user defined data types, making them (de)serializable. Serde uses mechanism to provide two custom derives, named serialize and deserialize, that can be implemented for user-defined data types. In this video, we will uses procedural macros for deriving serialize and deserialize.
Declare all our dependencies as extern crates
Setup a TCP server and a client
Computes the distance and sends back the result
In the Rust ecosystem, there are a few distinct ways of implementing PEGs, and each of those have their own strengths and weaknesses. The first way is using macros to define a domain-specific language for parsing.
Parse a simple string
Implement parser combinations
Parse an example HTTP request
In this video, we will how nom can be used to parse binary data. In our toy example, we will write a parser for the IPv6 header.
Declare a struct for the IPv6 fixed header
Define a function using the do_parse! macro
One of the most popular RPC implementations is gRPC. gRPC offers high performance RPC over internet scale networks and is widely used in a number of projects, including Kubernetes.0020 For our gRPC example, we will build a service that is a lot like Uber. It has a central server where clients (cabs) can record their names and locations.
Use the protoc-rust-grpc crate
Define all associated protobuf messages for each of the requests and responses
To process the responses, all the record_cab_location and get_cabs methods over RPC
Internet email uses a protocol called Simple Mail Transfer Protocol (SMTP), which is an IETF standard. Much like HTTP, it is a simple text protocol over TCP, using port 25 by default. In this video, we will look at a small example of using lettre for sending emails.
Send crash reports for a server
Create an instance of our CrashReport
Another common application layer protocol is the File Transfer Protocol (FTP). This is a text-based protocol, where the server and clients exchange text commands to upload and download files.
Interact with FTP servers using crate called rust-ftp
Connect to the server on port 21
Look at TFTP server using the crate called tftp_server
Hyper is arguably the most stable and well-known of Rust-based HTTP frameworks. It has two distinct components, one for writing HTTP servers and one for writing clients. In this video, our Http instance will be passed to multiple threads. Thus, we need to wrap it in an Automatically Reference Counting (ARC) pointer.
Write a small HTTP server in Hyper
Interact with the server with curl
Write a server that uses multi-threading
Rocket can only run on nightly, because it uses a bunch of features that are not stable yet.
Write an API server using Rocket
Set up our database using diesel CLI
Define errors for our API
In this video, we will discuss the reqwest crate and look at how to use it; this borrows heavily from the requests library in Python.
Use Serde to serialize and deserialize our data to JSON
Deserialize the response to a list of Post objects
Add asynchronous programming support using Tokio
The backbone of Rust's asynchronous programming story is the futures crate. This crate provides a construct called a future. We will learn more about it in this video
Add some libraries in our Cargo config
Simulate slowness
Work with streams and sinks
The Tokio ecosystem is an implementation of a network stack in Rust. It has all the major functionality of the standard library. We will learn more about it in this video.
Multiplex incoming connections in Tokio
Write streaming protocols
Look at some commonly used libraries
it is necessary to add some form of security between parties using HTTP to communicate. We will learn to add them.
Learn about basic scheme of things
Use OpenSSL library using Rust
A commonly used crate for cryptography is called ring. This crate supports a number of lower-level crypto primitives. We will learn to use it in this video.
Learn how protocol works
Create an example directory and place the two files
Handle each client in a new thread
Rust is an empowering language that provides a rare combination of safety, speed, and zero-cost abstractions. It is applicable to areas such as embedded programming, network programming, system programming, and web development. If you're a developer who wishes to build a strong programming foundation with this simple yet powerful programming language Rust, then this learning path is for you.
This course is designed to teach you the fundamentals of Rust and use them to build powerful Rust applications and networking software. You will start by learning concepts such as enums, functions, loops, arrays, data types, basic data structures, and working with strings. You will then learn how to write object-oriented code, work with generics, conduct pattern matching, and build macros. Next, to enhance your programming skills, you will build some concurrent, fast, and robust applications in Rust. Finally, you will learn high-performance networking concepts in Rust to build effective networking software.
Contents and Overview
This training program includes 3 complete courses, carefully chosen to give you the most comprehensive training possible.
The first course, RUST: The Easy Way, covers the fundamentals of the Rust programming language, its core concepts, and best coding practices. It starts with the basics and goes on to explain how to get started by developing a simple Rust program. You will also learn immutability, conditionals, loops, arrays, and strings to enhance your programming skills. Moving ahead, you will get a deeper understanding of Rust, by acquiring knowledge of structures, enums, and functions. Furthermore, you will learn to test your programs using Cargo. Additionally, you will get an experience of generic data types, the idea behind lifetimes, and concurrency in Rust.
In the second course, Introduction to Rust Programming, you will learn to build concurrent, fast, and robust applications. You will begin by learning the essentials of the language, including high-performance networking. You will then get a detailed explanation of the fundamentals of Rust programming. You will also learn how to write object-oriented code, work with generics, conduct pattern matching, and build macros.
The third course, Network Programming with Rust, will get you started with building networking software in Rust by taking you through all the essential concepts.
By the end of this course, you will be able to build your own robust applications and effective networking software with Rust.
Meet Your Expert(s):
We have the best work of the following esteemed author(s) to ensure that your learning journey is smooth:
Adnan Kičin is a software developer based in Sarajevo, Bosnia and Herzegovina. He is an active member of the programming community in Bosnia, and he has been organizing and hosting the Open Web Sarajevo Meetup for over a year now. He also co-hosted Sarajevo's first Hacktoberfest last year and organized the first Quora Meetup in Bosnia. Adnan has also been programming in C and C++, and to prevent himself from getting rusty, he started using Rust.
Syed Omar Faruk Towaha has degrees in Physics and Computer Science and Engineering from Shahjalal University of Science and Technology. He is currently working as the Chief Technology Officer at an IT company in his city while working remotely with a Chinese company as a hardware designer. He has a number of publications from different publications. His recent publications include Learning C for Arduino, JavaScript Projects for Kids, Fundamentals of Ruby, Easy Circuits for Kids, How you Should Design Algorithms, and so on. Previously Syed worked a number of companies as either software engineer or technical advisor. He volunteers Mozilla as a Reps. Syed has proved his experience in various fields such as Mobile Application Developments with Java, Kotlin, Objective C, Swift, AngularJS, Ionic, and so on. He has excelled in Software Development with C#, .NET, Java, C++, and Python. He designed a number of ICs’ and EDA’s layouts over last 4 years.
Abhishek Chanda studied computer science at IIEST Shibpur in India and electrical engineering at Rutgers University. He has been working on networking and distributed systems since 2008. Over his career, he has worked with large companies (like Microsoft and Dell) and small startups (Cloudscaling, DataSine) in India, US, and the UK. He is enthusiastic about open source software and has contributed to a number of projects like OpenStack, Nomad etc. He contributes to a number of open source projects. He came across Rust in 2015 and found it to be a perfect fit for writing highly performant systems.