Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Rust: Building Reusable Code with Rust from Scratch
Rating: 4.5 out of 5(520 ratings)
3,362 students

Rust: Building Reusable Code with Rust from Scratch

Use generics, traits, and macros to write clean and reusable Rust libraries that are easy to understand and maintain
Last updated 1/2019
English

What you'll learn

  • This course is aimed at developers, C/C++, Rust & System developers who are familiar with programming and want to learn how to code in Rust and re-use Rust code and libraries from scratch.

Course content

2 sections68 lectures6h 16m total length
  • The Course Overview1:34

    This video gives an overview of the entire course.                       

  • Bindings and Mutability2:15

    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

     

  • Built-In Types12:00

    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

     

  • Imports and Namespaces7:24

    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”

     

  • The Standard Library4:24

    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

     

  • Recursive Fibonacci5:14

    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

     

  • Dynamic Fibonacci7:23

    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

     

  • Installing Rust with Rustup2:17

    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

     

  • Managing Toolchains with Rustup2:29

    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

     

  • Creating Projects with Cargo8:15

    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

     

  • Exploring the Crate Ecosystem5:16

    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

     

  • Rustdoc and the Documentation Ecosystem4:36

    We talk about the Rust documentation ecosystem.                         

    • Learn the URL for projecting information on any particular crate

    • Explore and learn more about the doc

     

  • Adding Dependencies with Cargo14:01

    In this video, we will be adding dependencies with Cargo.                         

    • Use Cargo to build the project

     

  • Motivation for the Borrow Checker3:53

    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

     

  • Ownership, Borrowing, and RAII6:27

    In this video, we will talk about ownership, borrowing, and RAII.                         

    • Find out what ownership, borrowing and RAII is all about

     

  • Shared and Exclusive Access12:26

    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

     

  • Fighting with the Borrow Checker2:10

    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

     

  • Strings, Strs, Vecs, and Slices3:26

    In this video, we will learn about strings, strs, vecs, and slices.                         

    • Learn about strings and vecs

    • Learn about strs and slices

     

  • Understanding Borrow Checker Errors1:14

    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

     

  • Structured Data8:20

    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

     

  • Enumerations4:35

    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

     

  • Match Expressions10:56

    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

     

  • Designing a Markup Language4:37

    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

     

  • Implementing the Markup Language13:19

    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

     

  • Introduction to Traits2:05

    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

     

  • Built-In Traits3:00

    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

     

  • Writing Your Own Traits7:58

    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

     

  • Generic Functions5:40

    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

     

  • Generic Types2:02

    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

     

  • Trait Objects and Dynamic Dispatch4:13

    In this video, we will learn about traits, objects, and dynamic dispatch.                         

    • Learn about static dispatch

    • Learn about dynamic dispatch

     

  • Closures6:08

    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

     

  • Iterators5:17

    In this video, we will take a look at iterators.                         

    • Define iterators

    • Create iterators

    • Learn about the different methods used

     

  • Map, Filter, and Fold5:05

    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

     

  • Building a Barycenter Finder10:58

    In this video, we will learn about the Barycenter finder.                         

    • Create a program

    • Compute the gravitational center of the system – Barycenter

     

  • Parallelizing the Barycenter Finder11:10

    In this video, we will take a look at how to parallelize the Barycenter finder.                         

    • Parallelize the existing Barycenter program

    • Understand rayon and itertools

     

  • Breaking Up Code with Modules3:47

    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

     

  • Error Handling3:00

    In this video, we will discuss error handling.                         

    • Learn about the two error handling types

    • Propagate the errors upwards

     

  • API Design2:34

    In this video, we will take a look at API designs.                         

    • Use naming conventions

    • Learn about interoperability, document, and flexibility

     

  • Unit Testing18:00

    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

     

  • Integration Testing6:48

    In this video, we will learn about integration testing.                         

    • Implement the Bucketizer

    • Create a well-designed crate

     

  • Documentation7:27

    In this video, we will talk about documentation.                         

    • Discuss documentation in the Bucketizer project

    • Get a brief recap of the course

     

  • Test Your Knowledge

Requirements

  • This course is aimed at developers, C/C++ developers & system developers who are familiar with programming and want to learn how to code in Rust and re-use Rust codessss.

Description

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.

Who this course is for:

  • Discover the advantages of the Rust up toolchain manager and the Cargo build tool
  • Prevent data races and memory corruption by controlling exclusive versus shared access
  • Build powerful abstractions with traits and bounded generics
  • Create concise pipelines with closures and iterators
  • Understand generics and learn to use it to abstract algorithms for multiple data types
  • Define and enforce clear interface using traits
  • Explore how the standard library uses features such as generics, traits, and macros
  • Structure your code with modules and crates and publish them online