Skip to content

slgeay/rust-training

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Training

Setup

Installation

Rust

Cargo

VSCode Plugins

Material

Course, exercices, docs

Course

Tools

Exercices

Docs

Crates

Useful libraries
  • anyhow - application-level error handling
  • thiserror - error development for libraries
  • log - classical logging
  • tracing - span-oriented & structured logging, suitable for concurrency
  • divan - statistics-driven microbenchmarking
  • serde - serialize/deserialize data to JSON and other formats
  • rayon - easy data parallelism
  • crossbeam - advanced concurrency primitives
  • itertools - more functions for iteration
  • tokio - async runtime and related libraries for Rust

Exercices

Day 1
Day 2
Day 3
Day 4
Day 5
Day 6

Further Reading

Learning Rust

  • Our Rust training slides are often best at presenting information in a very condensed form!
  • Start with Rust by Example - quick snippets of code with some explanations.
  • Rust Book - Brown University version with some chapters reworked, added quizzes and memory diagrams. Very long, so I suggest reading specific chapters when you want to learn more about different topics.
  • Rustonomicon Still not sure about the topic and need to go deeper? Has great chapters on Rust memory management, unsafe, internal data representation, etc.
  • Learning Rust With Entirely Too Many Linked Lists goes deeper into Rust memory management. Starts with clone, moves to reference-counted pointers, and eventually showcases the use of unsafe in Rust for implementing a series of data structures.

API design and patterns

Rust projects organization

Rust FFI

Async Rust and Multithreading

  • Tokio Tutorial has a few sections covering async Rust in general.
  • Async Rust Today - written as stories with each one talking about a specific problem or difficulty and offering a set of solutions.
  • Actors with Tokio talks about using channels to work with resources.
  • mini-redis example - a very well-commented piece of code that showcases some real-world scenarios: async data sharing, work cancellation, graceful shutdown, etc. Many libraries and web frameworks take care of these tasks for you but this example is still useful to learn from.
  • Rust Atomics and Locks - at this point the best book about low-leven concurrency in general, not only in Rust. Describes things like locking, compare-and-swap, memory ordering, etc. on a hardware level, OS level and finally language level. If certain multithreading concepts make you feel lost this would be an excellent book.

Videos

Code

Crates.io website is a somewhat small web application, but it handles large amounts of traffic and covers common Server-side use-cases:

  • Authenticating with third-party services
  • Authorization and access control
  • File uploads and downloads
  • Background jobs
  • Error reporting, logging, monitoring, gathering metrics

Axum, SQLx, PostgreSQL, Heroku, AWS, Fastly

Books

  • 📖 Zero To Production In Rust the book walks you through building a typical web API backend and showcases how different aspects of it can be done in Rust. A large portion of the book is available as a series of blog posts on author's blog (scroll down to ToC).
  • 📖 Rust for Rustaceans is an intermediate-level book. It's very dense, contains almost no examples and instead talks about various aspects of the language in detail. Think "Rustonomicon+". Do not rush to read it right away, instead go back to it once you've done some Rust work and you feel the need to understand language fundamentals deeper.
  • 📖 Asynchronous Programming in Rust book by Carl Fredrik Samson explains in detail how different portions of Async Rust work. Doesn't go into patterns of Rust async programming, unfortunately.

Arcane knowledge

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages