Rust is a systems programming language with a focus on safety, especially safe concurrency, supporting both functional and imperative paradigms, syntactically similar to C++, but its designers intend it to provide better memory safety while still maintaining performance. With this hands-on, practical course, you’ll begin from scratch by getting familiar with the basic syntax and concepts of Rust, defining functions and creating variables & much more. Then you'll learn to test your code by building a simple crate with a tested, usable, well-documented API using Cargo & RustDoc. Next, you will work with different forms of code reuse, loops, map, filter and fold to save time and resources & to use your code in a reusable manner in your apps.
Rust is a systems programming language with a focus on safety, especially safe concurrency, supporting both functional and imperative paradigms, syntactically similar to C++, but its designers intend it to provide better memory safety while still maintaining performance. With this hands-on, practical course, you’ll begin from scratch by getting familiar with the basic syntax and concepts of Rust, defining functions and creating variables & much more. Then you'll learn to test your code by building a simple crate with a tested, usable, well-documented API using Cargo & RustDoc. Next, you will work with different forms of code reuse, loops, map, filter and fold to save time and resources & to use your code in a reusable manner in your apps.
By end of this course you will be able to avoid code duplication and write clean reusable code, also you'll be comfortable building various solutions in Rust
Contents and Overview
This training program includes 2 complete courses, carefully chosen to give you the most comprehensive training possible.
The first course, Learning Rust begins by getting familiar with the basic syntax and concepts of Rust, from writing a Hello World program to defining functions and creating variables. Then you’ll see how to manage toolchains with Rust up and build your first command-line program. Moving on, you’ll explore Rust’s type system to write better code and put it into practice in a simple markup language. You’ll learn to use Rust’s functional programming features to perform a physics simulation and use the Rayon crate to parallelize your computations. Finally, you’ll discover the best practices and test your code by building a simple crate with a tested, usable, well-documented API using Cargo and RustDoc. By the end of the video, you’ll be comfortable building various solutions in Rust. You’ll be able to take advantage of Rust’s powerful type system and a rich ecosystem of libraries, or “crates”, available through the Cargo package manager.
The second course, Building Reusable Code with Rust will start with teaching you how to build reusable Rust code so that you can stop copying and pasting the code. Write code that can adapt to many different usages. You will reuse code by using advanced features such as traits, generics, and macros. You will work with different forms of code reuse, loops, map, filter and fold to save time and resources. Achieve higher-level reuse without sacrificing runtime performance. Organize your code into modules and crates to publish them to crates .io. By the end of the course, you will be able to avoid code duplication and write clean reusable code.
This video gives an overview of the entire course.
In this video, we will examine the basic syntax of Rust and see its variables called “bindings” at work.
Learn that bindings are immutable by default
Learn that Rust supports mutable bindings
Know that the compiler will prevent us from using a variable that was not initialized
In this video, we will examine the built-in types provided by Rust.
Load up the Rust playground
Learn about the two types of Rust – strong and dynamic
Get acquainted with the built-in types and check on some programming as well
In this video, we will see how rust code is organized, see some more types, and build some more programs.
Learn some basics about crates and modules
Learn that there are a number of imports that come into a program, known as “preludes”
In this video, we will talk about the functionality that is available by default on every Rust program: Rust standard library.
Get to know about the contents of the rust standard library
Learn a bit about the Rust standard library’s philosophy
In this video, we will build a simple Fibonacci calculator.
Define the program to be written
Sketch out the implementation types
Build a working implementation
In this video, we will build a more efficient Fibonacci program.
Define the performance bottleneck of the previous program
Understand how dynamic programming will help
Implement a dynamic solution
In this video, we will cover installing and managing Rust with Rustup.
Learn about multiple release channels in Rust
Learn to install Rust on your system
Learn that Rustup makes it easier to manage the versions of other software
In this video, we will learn how to manage our tools with Rustup.
Learn the basic commands used in Rustup
Learn to set an override for a project
Discuss tradeoffs between stable, beta and nightly
In this video, we will talk about creating projects with Cargo.
Create a new project on our respective terminal
Create a main application file that runs all our codes and brings them all together
In this video, we talk about the crate ecosystem around rust.
Get to know about crates.io, a public crates repository
Learn about semantic versioning
We talk about the Rust documentation ecosystem.
Learn the URL for projecting information on any particular crate
Explore and learn more about the doc
In this video, we will be adding dependencies with Cargo.
Use Cargo to build the project
In this video, we will check out the importance of the borrow checker.
Discuss memory corruption problems
Explain how memory corruption problems are bad
Explain how the borrow checker prevents memory unsafety
In this video, we will talk about ownership, borrowing, and RAII.
Find out what ownership, borrowing and RAII is all about
In this video, we will take a look at shared and exclusive access and see how they work with the Rust compiler.
Create a program
Learn how to use shared and exclusive access
In this video, we will talk about the phenomenon of fighting with the borrow checker.
Learn what exactly fighting with the borrow checker means
Learn the different designs in a borrow checker
Learn why we must not fight the borrow checker
In this video, we will learn about strings, strs, vecs, and slices.
Learn about strings and vecs
Learn about strs and slices
In this video, we will understand and deal with borrow checker errors.
Understand what the borrow checker is
Get to know the types of borrow checker errors
In this video, we will talk about structured data, also known as structs or data structures
Create a simple program using struct and get the output
Explore the different ways in which we can use structs in our programs
In this video, we will examine another basic kind of type in rust called enumerations or enum.
Create a simple program using enum and get the output
Explore the different ways in which we can use enum in our programs
In this video, we talk about match expressions.
Create a program on the simulation of guiding a robot around using enumerations
Learn to write commands for the robot using enums
Learn to use the match expression in writing a program efficiently to control the robot
In this video, we will see how to design a simple markup language.
Create a simple program on finite-state machines
Explore what goes into designing the markup language
In this video, we implement the markup language.
Explore the previous program by making a few alterations
Learn to use the derivation keyword to copy and clone the values in the enum state
Explore the usage of several match expressions within the program
In this video, we will be taking a look at traits.
Learn the specific behavior of traits
Understand the default methods used in traits
Explore the syntax and parameters used in traits
In this video, we will discuss some of the built-in traits that come with the rust compiler and standard library.
Learn about comparison
Learn about display and debug
Learn about clone and copy and also about the iterator
In this video, we will learn how to write our own traits.
Understand the various applications of traits
Create a simple program
Learn how to use traits within the program
In this video, we will learn about generic functions.
Learn about arguments for generic functions
Learn the generic syntax and trait bounds
Explore the concepts through a programming example
In this video, we will learn about generic types.
Learn about arguments for generic types
Learn about generic type syntax
Learn about existing generic types
In this video, we will learn about traits, objects, and dynamic dispatch.
Learn about static dispatch
Learn about dynamic dispatch
In this video, we will learn about closures in Rust.
Learn what are closures and their syntax
Understand closure syntax
Learn various other concepts such as closing variables, closure return strategies, and so on
In this video, we will take a look at iterators.
Define iterators
Create iterators
Learn about the different methods used
In this video, we will learn map, filter, and fold.
Learn about map, filter, and fold
Learn about the combination of the three
Understand the perks of using them
In this video, we will learn about the Barycenter finder.
Create a program
Compute the gravitational center of the system – Barycenter
In this video, we will take a look at how to parallelize the Barycenter finder.
Parallelize the existing Barycenter program
Understand rayon and itertools
In this video, we will take a look at breaking up code with modules.
Understand why it is important to break up code
Learn the basic organization
Understand that it is important to document the code
In this video, we will discuss error handling.
Learn about the two error handling types
Propagate the errors upwards
In this video, we will take a look at API designs.
Use naming conventions
Learn about interoperability, document, and flexibility
In this video, we will learn about unit testing.
Create a new rust library called Bucketizer
Understand that working on unit tests helps to iterate new designs without any application code
In this video, we will learn about integration testing.
Implement the Bucketizer
Create a well-designed crate
In this video, we will talk about documentation.
Discuss documentation in the Bucketizer project
Get a brief recap of the course
This video provides an overview of the entire course.
How can we try the code examples from the course? By setting up the Rust development environment.
Understand the options available: playground and rustup
Learn to test simple code using the online playground
Learn to install the toolchain locally with rustup
A brief overview of the code reuse mechanisms in Rust, which we'll discuss further in the course.
Understand the considerations of code reusability
Learn what Rust provides us for code reuse
How do we avoid repetitive code using loops and properly use iterators?
See why for loops only accept iterators
Learn what the IntoIterator trait has to do with the for loop
Understand the ways to get different iterators with or without reference
The aim of this video is to learn an alternative way of doing loops.
Learn iterator adaptor and consuming adaptor
Know when we should use functional programming loops as against for loops
See how lazy evaluation can help you do more than a for loop
How we can use one of the most common features in programming languages—functions—to avoid duplication?
Understand the basic syntax of functions
See how functions take typed parameters
Learn the common mistake of moving ownership into a function
How and where can generics help us to reuse code in Rust?
Learn how generics can help us reuse high-level algorithms
Learn how generics can help us reuse high-level data structures
Understand where generics can be applied
How can we reuse an algorithm for different types? Generic functions can help us abstract away the types in a function signature.
Understand the basic syntax of generics in functions
Know why not all types can fit into all generic functions
See how we can use a trait bound to restrict the types used in a generic function
How to reuse common data structures for different types? With generic on structs and enums.
Learn how generic struct can abstract away the types
Learn how multiple generic types can be used in one struct
Understand how the same concept can be applied to enums
The aim of this video is to learn how struct methods can use generic just like normal functions.
Learn the basic syntax of generic on struct methods
Understand why we need impl<T> instead of just impl
See how we can implement a generic struct method for only certain types
Show how generics are used in the Rust standard library.
See how option<T> uses generic to represent optional values
See how result<T> uses generic to represent a success/fail result
Know how to use option and result in error handling
The aim of this video is to showcase how generics are used in the Rust standard library.
See how collections like vector or hash use generics
Learn how smart pointers and wrappers use generics
See how we can compose wrappers using the generic syntax
The aim of this video is to learn the basic syntax of trait and trait bound.
Learn the basic syntax of trait
See how trait can help us define interfaces
Learn how trait bound can help us enforce interfaces
How can we enforce and use a trait without knowing the solid type? Trait bounds and trait objects can help us here.
See how trait bounds are used in a real-world example
Learn the "where" form of trait bound syntax
See how a trait object can be used instead of a solid type
Using generics on traits may cause us to accidentally create multiple implementations. Associated type can guarantee that it's only implemented once.
Understand why generics on traits may cause multiple implementations
See how associated type solves this problem
Learn how trait inheritance can enforce more complex trait relationships
Traits and generics have different effects on performance. Learn the difference between static dispatch and dynamic dispatch.
Learn about static dispatch and the code bloat problem
Learn about dynamic dispatch and its performance impact
See how a trait object is implemented internally
How do we do operator overloading and type conversion in Rust? The Rust standard library uses traits for this.
See how operator overloading can be achieved by traits
Learn how lifetime and function calls also utilize traits
Understand how From and Into traits help us do type conversion
How to tell the compiler that our custom type has a special property? Marker traits will help. We also talk about some useful std traits.
Learn about marker traits and how they interact with the compiler
Know how to define custom formatting with Display and Debug
Learn how a default trait can be useful in defining defaults
Learn what metaprogramming is and the tools available in Rust.
Learn what metaprogramming is
Understand the options for metaprogramming in Rust
Know when to use metaprogramming
Some code repetition is not possible to eliminate by the language itself. We can use declarative macros to abstract away that.
Understand the syntax for defining declarative macros
See a real-world example of vec!()
Learn about the namespace for macro and why we need macro_use
Implementing repetitive traits is cumbersome. Using procedural macros, we can create custom derive rules to reduce clutter.
Learn how custom derive works
Learn how we organize the folder structure for custom derive code
Understand how we use proc_macro, syn, and quote to achieve the custom derive logic
The aim of this video is to walk through important macros in the Rust standard library.
Briefly review what we’ve learned about derive
Walk through macros for formatting
Walk through macros for introspection, including files, and more
The aim of this video is to walk through important macros in the Rust standard library.
Walk through macros for conditional compiling
Walk through macros for error handling
Walk through macros that aid development like unimplemented, panic, or assert
How do we create a self-contained unit of module that can be reused? Using Cargo to create crates.
Learn how the "cargo new" command creates crates
Learn how a binary crate is structured
Learn how a library crate is structured
How do we create namespace in crates to convey the structure of our code? Modules are built exactly for that.
See how module definition works in one file
Learn how we can split modules into files and folders
Understand how the "pub" keyword controls the accessibility of modules
How do we reuse the modules we created or other people created? We can specify the dependency in Cargo.toml.
Learn how Cargo.toml works
How to use third-party or local crates
How to include the crate in the code with "extern crate" and "use"
How do we publish our crate to the world? We need to put them on crates.io.
Understand what crates.io is
Understand the requirement for your crate to be published
Demonstrate the procedure of publishing to crates.io
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.