We may earn an affiliate commission when you visit our partners.
Course image
Dmitri Nesteruk

This course will teach you the fundamentals of Rust, a modern programming language that has the both the power of native code as well as the safety of some managed languages. In this course you will learn the following:

Read more

This course will teach you the fundamentals of Rust, a modern programming language that has the both the power of native code as well as the safety of some managed languages. In this course you will learn the following:

  • How to download and install Rust; how to compile programs and (optionally) work with an IDE.
  • Learn about fundamental data types and how to use them to declare variables.
  • Undersand arrays, vectors and strings, the concept of slices.
  • Learn to create functions, methods, closures, higher-order functions.
  • Understand how to create various data structures such as structs and enums; also traits.
  • Master Rust's explicit take on the concept of lifetime with ownership, borrowing, lifetime specifiers, lifetime elision.
  • Learn how to safely share data around your (possibly multithreaded) application with Rc, Arc and Mutex.
  • Use Rust's package managent using Cargo.
  • Learn about other useful topics: documentation, conditional compilation, testing.

This course, like all my other courses, will be supplemented with additional lectures based on participants' requests.

Enroll now

Here's a deal for you

We found an offer that may be relevant to this course.
Save money when you learn. All coupon codes, vouchers, and discounts are applied automatically unless otherwise noted.

What's inside

Learning objectives

  • Solve problems in rust
  • Understand rust's strengths and weaknesses
  • Effectively leverage rust's memory safety guarantees
  • Write applications and libraries
  • Test and document your code

Syllabus

Let's get comfortable with Rust!

Welcome to the course! Now, for a taste of things to come...

Let's get started by installing Rust.

Read more

The obligatory Hello, World! demo, made with Rust.

Learn about Cargo, Rust's own project and dependency management system. 

Note that Cargo configures your folder to be a Git repository and creates a .gitignore file.

A discussion of the free IntelliJ IDEA Community IDE and how to set it up to work with Rust.

Learn to declare all types of variables.

An overview of bits, bytes and the sizes of numbers that can be represented in a typical programming language.

Some preliminaries before we get started. Here we discuss the application entrypoint — the main function; also we discuss functions in general and the println! macro.

Learn about boolean, integral, floating-point types and the char type.

A description of some of the Rust operators such as +, <=, && and so on.

A discussion of scopes and how variables in inner scopes can shadow outer variables.

Global values that are unlikely to change.

Learn about the distinction between the stack and the heap,

A demonstration of how to debug Rust applications in CLion. Debugging skills are critical to successful Rust application development, so pay attention!

Learn about typical control flow structures.

Learn about the if statement, including some unusual syntax. (And no, Rust does not have a ternary ?: operator.)

A look at conditional and unconditional loops.

for loops... also very unusual.

A look at match which lets you pick the right option based on matching input plus additional conditions. Very powerful!

A simple example using control flow constructs.

Learn about Rust's various data structures.

A very important topic! Structs let us keep related data together in a single object.

(Note: there is no concept of constructor in Rust.)

A traffic light can be red, green or blue. How to best represent this information in a program?

With the release of Rust 1.19, we've got a new data type called a union. A union can define several fields of different type, but they all occupy the same memory. Unions are very useful for C interop, among other things.

Here we talk about a very useful type called Option<T>, the None/Some(x) duality, and also discuss the if let and while let declarations.

Learn how to store multiple values of any type in a single data structure as well as how to go over those values.

A slice is a read-only view into an array or a vector.

Learn about tuples, their destructuring and indexing. (Yes, destructuring is a word.)

Now that we know more about various data structures, let's revisit the match keyword and discuss pattern matching, an extremely powerful technique.

Learn about generic structures.

Learn how to use standard Rust collections

A look at the key Rust collections.

A vector is like an array, but resizeable. Also behaves like a stack.

A key-value store that allows fast access and update/upsert operations.

A data structure that represents a mathematical set.

Some notes about iterators in Rust.

Learn about ways you can manipulate text

Strings are used to store text (i.e., sequences of characters). Learn about both str and String. Both are valid UTF-8 sequences of bytes.

Why does str exist? Because an ordinary slice of a String is effectively a slice of Vec<u8>, which is not very useful.

Learn about the format! macro.

A tiny game.

Learn how to create your own functions.

We've already met the function main, but now we discuss functions at large.

A struct can have not just fields but also its own functions!

How do you store a function in a variable? How do you pass a function to some other function? These concerns are addressed with closures (a.k.a. lambda functions).

Functions that return functions. Don't worry, it's not as scary as it sounds.

Traits let us enrich types with behaviors

Traits let you specify that a type must possess certain aspects.

Three forms of syntax for passing traits as parameters.

A look at the Into trait, which helps with automatic conversions.

A way of giving your structs destructors.

Learn how to define the behavior of operators such as + for your own structs.

One of two possible forms of dispatch. Static dispatch is when the compiler knows exactly which realization of function to call.

What if the compiler doesn't know which trait implementation to call?

So given that static dispatch is faster, why would we want to use dynamic dispatch, anyway?

You cannot make vectors of different objects. But if you really need to, you can make a vector of enum cases or of pointers (&, Box, Rc, etc.)

Learn about the ways Rust's memory guarantees are enforced.

Learn about ownership, move semantics and move-able types.

Borrowing

We finally get to look at explicit use of lifetime specifiers. Woo-hoo!

A look at how lifetimes are defined in implementations of structs.

In addition to ownership/borrowing, Rust also supports the notion of reference-counted variables. These are somewhat easier to share. The approach is similar to C++'s shared_ptr/unique_ptr.

A reference-counted variable (Rc) is safe to share around within a single thread. But what if we want to share it around in multiple threads? How can we ensure its pointer count is actually safe from concurrent modification? That's what the Arc class is for.

Arc protects the reference count, but it doesn't protect the variable itself, so concurrent modification of the variable will still be prohibited by the Rust compiler. How can we get concurrent code that mutates the variable to work? One option is to use a Mutex.

Learn about advanced features of Rust

In Rust, circular references are difficult to get right.

Learn to use concurrency features in Rust

The first step on the road to concurrency is to learn how to spawn a thread of execution and then wait on it to complete (a.k.a. join).

These things are just good to know.

Let's try using a crate that's available on crates.io.

Let's build our own crate out of separate modules... and then consume it!

Now that we know about functions, we can write unit and integration tests.

Learn how to document your own code.

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Provides hands-on labs and interactive material, making learning more engaging
Develops a solid foundation for accessing more advanced topics
Covers memory guarantees and how they are enforced, ensuring greater security
Emphasizes practical industry knowledge, ensuring relevance
Taught by recognized experts in the field, ensuring up-to-date knowledge
Requires software knowledge and additional goods, which may create barriers for some learners

Save this course

Save The Rust Programming Language to your list so you can find it easily later:
Save

Reviews summary

Good for beginners, but dated syntax

According to students, this course is well received by learners, particularly those new to Rust. Learners generally say that the course is great for beginners and that the concepts are solid. However, learners note that the syntax is a bit dated and the course could use more code examples.
Course is beginner friendly.
"This course is great for beginners"
Course could use more examples.
"Could use some more code examples."
Syntax used in the course is out of date.
"the syntax is a bit dated"

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in The Rust Programming Language with these activities:
Join a Rust Study Group
Learn Rust with other students in a study group.
Browse courses on Rust
Show steps
  • Find a Rust study group in your area or online.
  • Join the study group.
  • Attend the study group meetings.
  • Participate in discussions and ask questions.
Attend a Rust Meetup
Connect with other Rust developers and learn about the latest Rust news and trends.
Browse courses on Rust
Show steps
  • Find a Rust meetup in your area.
  • Attend the meetup.
  • Introduce yourself to other Rust developers.
  • Ask questions and learn about the latest Rust news and trends.
Read The Rust Programming Language
Get a solid foundation to build on for the rest of the course.
Show steps
  • Purchase a copy of the book.
  • Read Chapters 1-5.
  • Complete the exercises in Chapters 1-5.
  • Summarize the main points of each chapter.
  • Discuss the book with a friend or colleague.
Five other activities
Expand to see all activities and additional details
Show all eight activities
Follow a Rust Tutorial Series
Learn Rust by following a guided tutorial series.
Browse courses on Rust
Show steps
  • Find a Rust tutorial series that is appropriate for your skill level.
  • Follow the steps in the tutorial series.
  • Complete the exercises in the tutorial series.
  • Ask for help from the tutorial author or other students if you get stuck.
Solve Rust Coding Challenges
Sharpen your Rust skills by solving coding challenges.
Browse courses on Rust
Show steps
  • Find a website or online forum that offers Rust coding challenges.
  • Choose a challenge and attempt to solve it.
  • If you get stuck, ask for help from a friend or colleague.
  • Once you've solved the challenge, submit your solution.
Build a Simple Rust Calculator
Put your new Rust skills to the test by building a simple calculator.
Browse courses on Rust
Show steps
  • Plan the design of your calculator.
  • Write the Rust code for your calculator.
  • Test your calculator.
  • Deploy your calculator to a website or mobile app.
Build a Rust Library
Contribute to the Rust ecosystem by building your own library.
Browse courses on Rust
Show steps
  • Choose a problem that you want to solve with your library.
  • Design the interface for your library.
  • Implement the functionality for your library.
  • Test your library.
  • Publish your library to crates.io.
Write a Blog Post About Rust
Share your knowledge of Rust with the world by writing a blog post.
Browse courses on Rust
Show steps
  • Choose a topic for your blog post.
  • Write an outline for your blog post.
  • Write the content for your blog post.
  • Edit and proofread your blog post.
  • Publish your blog post.

Career center

Learners who complete The Rust Programming Language will develop knowledge and skills that may be useful to these careers:
Data Scientist
A Data Scientist is someone who extracts knowledge from data using scientific methods, often to help businesses learn more about their operations, customers, and market opportunities. The Rust Programming Language course can help build a foundation for Data Science by teaching you how to manipulate data in various ways and how to test code. Rust has the added benefit of high performance and memory safety guarantees, which are highly valued in data analysis and machine learning.
Embedded Systems Engineer
An Embedded Systems Engineer is responsible for designing and developing software for embedded systems, which are computer systems designed for specific purposes. Rust is a popular language in this field because of its memory safety and high performance. The Rust Programming Language course can help build a strong foundation for Embedded Systems Engineers to work with Rust, allowing them to develop more efficient and reliable embedded systems.
Software Engineer
As a Software Engineer, you will get to use your creative and technical skills to design, program, implement, test, and maintain software programs. Knowledge of Rust is regarded as a plus in the software engineering field because of its safety and efficiency. With its emphasis on memory management and concurrency, The Rust Programming Language course addresses some of the biggest challenges faced by Software Engineers on a daily basis.
Data Engineer
A Data Engineer is someone who designs, builds, and maintains data pipelines and systems. The Rust Programming Language course may be of interest to aspiring Data Engineers because Rust is a good choice for high-performance data processing tasks due to its memory safety and concurrency features. Learning Rust can help aspiring Data Engineers develop more efficient and robust data engineering solutions.
Cybersecurity Analyst
Cybersecurity Analysts protect computer systems and networks from unauthorized access, use, disclosure, disruption, modification, or destruction. Rust is a popular programming language in the cybersecurity field due to its memory safety and concurrency features. The Rust Programming Language course can help Cybersecurity Analysts learn about Rust and how it can be used to develop their own secure software.
Computer Systems Analyst
Computer Systems Analysts are responsible for analyzing and designing computer systems. The Rust Programming Language course can help aspiring Computer Systems Analysts by providing them with a solid understanding of Rust. Rust is known for its memory safety and concurrency features, which are important for developing reliable and efficient computer systems.
Quantitative Analyst
Quantitative Analysts use mathematical and statistical modeling, coding, and data analysis to help businesses assess risk, make informed decisions, and optimize performance. The Rust Programming Language course can introduce aspiring Quantitative Analysts to the Rust programming language and help them learn how Rust can be used to handle the large, complex datasets often used in quantitative analysis.
Blockchain Developer
A Blockchain Developer is someone who creates, deploys and maintains blockchain applications and systems. While not strictly required for a Blockchain Developer role, Rust is highly regarded for its ability to develop secure, concurrent, and scalable blockchain systems. The Rust Programming Language course can help aspiring Blockchain Developers learn how to leverage Rust's features in their blockchain development work.
DevOps Engineer
DevOps Engineers improve the collaboration between software development and IT operations teams, helping to automate and streamline the software development process. While not explicitly part of The Rust Programming Language course, Rust is known for its efficiency and reliability, which are important in DevOps work. This course can help aspiring DevOps Engineers learn Rust, enabling them to develop more robust and efficient DevOps tools and pipelines.
Cloud Architect
Cloud Architects are responsible for designing and managing cloud computing solutions. While The Rust Programming Language course doesn't specifically focus on cloud computing, Rust is a good choice for cloud-based applications due to its high performance and concurrency features. Learning Rust can help aspiring Cloud Architects develop more efficient and scalable cloud applications.
Game Developer
A Game Developer is someone who designs, develops, and maintains video games and game software. Although not specifically taught in The Rust Programming Language course, Rust is widely recognized in the game development industry for its memory safety and high performance. The course can provide Game Developers with a solid technical foundation in Rust, enabling them to develop more efficient and reliable game code.
Web Developer
A Web Developer is responsible for the design and maintenance of websites and web applications. While The Rust Programming Language course doesn't specifically focus on web development, learning Rust can help Web Developers create more secure and performant web applications. Rust is regarded as a good choice for web development due to its concurrency features.
IT Project Manager
IT Project Managers oversee and manage information technology (IT) projects. While The Rust Programming Language course doesn't specifically focus on IT project management, it can provide a valuable foundation in Rust for IT Project Managers. Rust is regarded as a reliable and efficient language for developing software, which can be useful for understanding and managing software development projects.
Technical Writer
Technical Writers create and maintain technical documentation, such as user manuals, technical papers, and white papers. While not a direct requirement for Technical Writers, The Rust Programming Language course can help aspiring Technical Writers build a foundation in Rust, which is a popular language for systems programming. This knowledge can be helpful for understanding and writing about Rust-based systems and applications.
Database Administrator
Database Administrators are database experts who ensure that database management systems run smoothly, efficiently, and reliably. The Rust Programming Language course may be of interest to those who wish to pursue a career as a Database Administrator because Rust is known for its high performance and concurrency features, which are crucial for managing large, complex databases.

Featured in The Course Notes

This course is mentioned in our blog, The Course Notes. Read one article that features The Rust Programming Language:

Reading list

We've selected eight books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in The Rust Programming Language.
The official book for learning Rust, written by the Rust core team. It covers all the basics of the language, including its syntax, semantics, and standard library.
Comprehensive guide to Rust, covering both the language itself and the Rust ecosystem. It great resource for anyone who wants to learn more about Rust or improve their programming skills.
A practical guide to Rust, covering topics such as memory management, concurrency, and system programming.
A comprehensive guide to Rust, covering topics such as ownership, borrowing, and lifetimes.
Deep dive into the Rust programming language, covering the language's internals and advanced features. It great resource for anyone who wants to learn more about how Rust works or improve their programming skills.
A collection of Rust recipes, covering topics such as working with strings, files, and networks.
A guide to building Rust applications, covering topics such as testing, deployment, and performance optimization.

Share

Help others find this course page by sharing it with your friends and followers:
Our mission

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.

Affiliate disclosure

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.

© 2016 - 2024 OpenCourser