Programming in Rust

Course objectives

Delegates will learn:

  • how to create projects and manage dependencies using the Cargo manager
  • language syntax, object-oriented model (traits) and elements of functional programming
  • language mechanisms that significantly improve code security, such as variable lifetime control, memory management philosophy, and thread safety

Course syllabus

Introducing Rust

  • Rust toolchain: compiler, debugger, Cargo
  • Project structure and dependency management

Common programming concepts

  • Basic data types
  • Constants and variables
  • Control flow
    • if statements and expressions
    • loops
  • Functions
  • Arrays, slices and vectors
  • Tuples

Structs

  • Named-field structs
  • Tuple-like structs
  • Unit-like structs
  • Struct layout
  • Defining methods with impl
  • Generic structs
  • Deriving common traits for struct types

Enums and Pattern Matching

  • Enums
  • Matching using patterns
  • Refutable Patterns with if let and while let

Ownership & Borrow

  • Ownership
  • Moves and copy
  • References
  • Borrowing variables
    • Sharing vs. Mutating
    • Reference safety in Rust
    • Lifetime annotations

Memory management

  • Resource management in Rust: Drop trait
  • The stack and the heap
  • Smart Pointers in Rust
    • Box, Rc and Arc
  • Interior mutablility: Cell<T> and RefCell<T>

Error handling

  • Panic - unwinding & aborting
  • Error handling in Rust
    • Catching & propagating errors
    • Handling errors in main()
    • Declaring a custom error type

OOP in Rust

  • Defining structures
  • Implementing functions for structures
  • Traits
  • Idioms and OOP design patterns  

Functional programming

  • Anonymous functions and closures
  • Idioms and FP design patterns

Managing projects

  • Crates
  • Modules and packages
  • Cargo package manager

Multithreading

  • Creating threads - Fork-Join Parallelism
  • Sharing data across threads
    • Mutexes in Rust
  • Message passing using channels

Testing

  • Writing and running unit tests
  • Organizing tests in Rust project

Prerequisites

Basic knowledge of another imperative programming language.

Course duration

4 days, 8 class hours each
On-site course quote

In-house training course.

Run at your company premises.

Get a quote
On-line course quote

In-house training course.

Delivered live in a virtual classroom.

Get a quote
Upcoming public courses
June 16 - 19, 2025 3990 PLN Enrol

Other dates?

Enquire now