Programming · PRC-28

Rust Programming

Rust Programming is a foundation course in the Rust language, from Cargo, ownership, borrowing, structs, enums, traits and error handling to asynchronous code with Tokio. It suits developers who want to build web services in Rust and backend developers looking for a fast, memory-safe language, and you leave able to build a web API with Axum and PostgreSQL.

Updated
From 6,750 THB / person 7,500 −10% excl. VAT 7% · group rates available
PDFDownload the course outline
  • Duration12 hours · 2 days
  • FormatOnsite / live online
  • Next round21–22 Jan 27
  • CertificateIncluded

Course overview

Rust delivers performance on a par with C and C++ while preventing memory errors at compile time, without a garbage collector. That is why it is increasingly used for systems work, command-line tools and backends that need both speed and stability. Beginners, however, often get stuck on ownership, borrowing and lifetimes, ideas that other languages do not have, and never get as far as building something real.

This course lays the foundations of Rust with the 2024 edition: Cargo, data types, ownership and borrowing, structs, enums, pattern matching, error handling, traits, generics and iterators, together with the code quality tools Clippy and rustfmt. Learners then put it all to work in a real web API with Tokio and Axum, connect to PostgreSQL with SQLx and add user accounts and authentication, before closing with a workshop that builds a RESTful service running on Docker. (2 days, 6 hours per day, 12 hours in total, Beginner-Intermediate level.)

What you’ll gain

  • Install Rust with rustup and manage projects confidently with Cargo
  • Understand ownership, borrowing and lifetimes well enough to read the compiler's messages
  • Design code with structs, enums, pattern matching, traits and generics
  • Handle errors systematically with Result, Option and the ? operator
  • Write asynchronous code with Tokio and build web APIs with Axum
  • Connect to PostgreSQL with SQLx, including migrations and connection pooling
  • Add user accounts, hash passwords and authenticate with tokens
  • Test a Rust service and package it as a Docker image

Who this course is for

  • Developers who want to build web services in Rust
  • Backend developers working in Go, Node.js, Java or Python who want a faster, safer language
  • Anyone who wants to learn a language focused on performance and memory safety
  • Systems engineers who want to write tools or services that work closer to the system

Prerequisites

  • Programming experience in at least one language, such as Python, JavaScript, Go, Java or C#
  • Basic web knowledge such as HTTP, JSON and REST APIs
  • Basic command-line and Git skills
  • A laptop that can run Rust, VS Code and Docker Desktop, with permission to install software

Curriculum

Course Details

This course is a 2026 edition that replaces the previous Rust Programming course, which taught Actix Web with Diesel. It has been rewritten for the Rust 2024 edition. It runs for 2 days, 6 hours per day (12 hours in total, 09:00-16:00), as lectures with labs. Beginner-Intermediate level. Day one builds solid language foundations, especially ownership, borrowing and error handling. Day two builds a real web API with Tokio, Axum 0.8 and SQLx with PostgreSQL on Docker, including authentication and testing. Every lab runs on the learner's own machine with open source tools. Learners take home a lab guide, sample code for every lab and the RESTful service project from the workshop.

Day 1 Rust Language Foundations

Section 1: Lab: Getting Started with Rust and Cargo

  • What Rust is good for, and how it differs from C++, Go and garbage-collected languages
  • Installing with rustup, the six-week release cycle and the 2024 edition
  • cargo new, build, run, check and cargo build --release
  • Lab: a first program formatted with rustfmt and checked with Clippy

Section 2: Data Types and Control Flow

  • Variables, mut, shadowing and type inference
  • String versus &str and working with UTF-8 text, including Thai
  • if, loop, while, for and let chains in the 2024 edition
  • Lab: a shipping cost calculator driven by user input

Section 3: Ownership, Borrowing and Lifetimes

  • How move, clone and copy differ
  • &T and &mut T references and the borrow checker's rules
  • Slices and an introduction to lifetimes in functions
  • Lab: fix code that will not compile by reading the compiler's messages

Section 4: Lab: Structs, Enums and Pattern Matching

  • Structs, methods and associated functions
  • Enums that carry data, and Option in place of null
  • match, if let and let-else
  • Lab: an order data model with its status expressed as an enum

Section 5: Systematic Error Handling

  • panic versus Result, and when to use each
  • The ? operator for propagating errors
  • Custom error types with thiserror, and anyhow at the application level
  • Lab: read a CSV file and report errors people can understand

Section 6: Lab: Traits, Generics, Closures and Iterators

  • Traits in place of class inheritance, and standard traits such as Debug, Display and From
  • Generics and trait bounds
  • Closures and iterators: map, filter, fold and collect
  • Lab: summarise sales from a list of orders with iterators
Day 2 Building a Web API with Rust

Section 7: Modules, Crates and Testing

  • Organising code with mod, pub and use
  • Library and binary crates, and Cargo workspaces
  • Unit tests, integration tests and cargo test
  • Lab: move the business logic into a library with tests

Section 8: Async with Tokio

  • async and await, the runtime, #[tokio::main] and tokio::spawn
  • Sharing data safely between tasks with Arc and Mutex
  • Calling external APIs asynchronously with reqwest
  • Lab: fetch data from several APIs at once and combine the results

Section 9: Lab: A Web API with Axum

  • Routers, handlers and {id} path parameters in Axum 0.8
  • Extractors Path, Query, Json and State, with JSON handled by Serde
  • Middleware from tower-http: logging, CORS and timeouts
  • Lab: a product API with in-memory storage

Section 10: Lab: PostgreSQL with SQLx

  • Run PostgreSQL on Docker, create a PgPool and run migrations with sqlx-cli
  • query! and query_as! with compile-time SQL checking, and offline mode
  • Create, read, update and delete data, with transactions
  • Lab: move the product API to PostgreSQL storage

Section 11: User Accounts and Authentication

  • Design a user model and store passwords with Argon2
  • Log in and issue JWT tokens
  • Check tokens with an extractor or middleware before a route runs
  • Lab: allow only logged-in users to create, update and delete products

Section 12: Workshop: A RESTful Service with Docker

  • Workshop: design the endpoints of an ordering service from a brief
  • Write integration tests for the API against a test database
  • Package it as a small Docker image with a multi-stage build
  • Next steps such as Actix Web, gRPC and WebAssembly

Schedule & training options

For individuals — public rounds

21–22January
Classroom21–22 Jan 27
20 seats left
18–19May
Classroom18–19 May 27
20 seats left
23–24September
Classroom23–24 Sep 27
20 seats left

For organisations — in-house / private

  • Tailor the content to your team’s tools and projects
  • Your dates, at your office or live online
  • Quotation with tax ID for procurement
Corporate training quote

Instructors

Frequently asked questions

What are ownership and borrowing in Rust?

Rust manages memory through ownership: each value has one owner at a time, and when the owner goes out of scope the memory is freed immediately, with no garbage collector. To let other code use a value without moving ownership, you borrow it through references: many read-only references (&T) or a single mutable reference (&mut T) at once. The compiler enforces these rules, preventing data races and dangling pointers before the program ever runs.

What is Cargo and which commands are used most often?

Cargo is Rust's project and package manager. You create a project with cargo new, check code quickly with cargo check, run it with cargo run, compile for production with cargo build --release and test with cargo test. External libraries, called crates, are listed in Cargo.toml and Cargo downloads them from crates.io. cargo fmt formats code, cargo clippy points out code that could be improved and cargo doc generates documentation from code comments.

What are the steps to build a web API with Axum and PostgreSQL?

Add tokio, axum, serde and sqlx to Cargo.toml, then write an async main function that creates a PostgreSQL connection pool and runs the migrations. Build a Router that binds routes to handlers and share the pool with every handler through State. Each handler takes its input through extractors such as Path or Json, reads or writes data with SQLx's query! macro, which checks the SQL at compile time, and returns JSON with the right status code.

Who is the Rust Programming course for, and what should I know beforehand?

It suits developers who want to build web services in Rust, backend developers who use another language and want something faster and safer, people who want a language focused on performance and memory safety, and systems engineers who want to write tools that work closer to the system. You should be able to program in at least one language and understand web basics such as HTTP, JSON and REST APIs.

What will I be able to do after the Rust Programming course?

You will be able to write Rust with a sound grasp of ownership, borrowing and lifetimes, design code with structs, enums, traits and generics, handle errors systematically, manage projects with Cargo, Clippy and tests, write async code with Tokio, build web APIs with Axum, connect to PostgreSQL with SQLx, add user authentication and package a service as a Docker image. Participants who complete the training receive a Certificate of Completion with its own number, which can be verified online.

Can the Rust Programming course be run in-house for our team?

Yes. It can be run in-house for your team, with examples adapted to your own work, such as building a Rust RESTful service around data or systems your team already manages. You can request a quotation from this page, or contact us on LINE @itgenius or by phone on 02-570-8449.