2-3 days on-site or remote
Rust for the Web
Rust has become one of the most popular new programming languages in recent years. The combination of performance on the level of C++ with stability and security on the level of managed languages like C# or Java is attractive to many development teams.
This workshop provides a smooth entry into the language for teams that are looking for leveraging Rust's capability in their web projects. We will teach everything you need to know about the language and wider ecosystem to be able to write your own HTTP server in the end!
What is Rust
A quick intro into what Rust is, how it came to life and what its core values are.
We will go over Rust's main three CLI tools (
rustc) and how to install them.
We will have a look at regular variables, immutable variables, constants, scoping, and shadowing.
In this stage we will take a look at Rust's fundamental types such as boolean, numbers, and characters.
If we only had variables, then applications would be somewhat boring. This stage will teach you all about writing reusable functions in Rust.
Rust not only offers built-in basic types, but also compound types like structs, tuples, enums and others which will be covered in this stage.
ifconditions, as well as
whilethat most developers are familiar with, we will learn about topics like pattern matching and the built-in
Resultenums in this stage.
This stage goes into depth on error handling, building on what was learned about the
Resultenum in the previous stage.
Ownership and Borrowing
The ownership and borrowing model is a significant aspect of Rust and the main reason for the security guarantees it makes. We will look at a few basic examples and exercises to ensure these basic rules and mechanisms are well understood.
Rust has a built-in documentation generator and in this stage we will see how we can take advantage of that to document our own code.
Unit tests, integration tests, documentation tests... after this stage, participants will be able to write all of them with comfort.
Rust has a few different types of strings, and each serves a different purpose. This stage will give a basic understanding of when to use which type.
During this stage, we will look at how to associate functions with structs, basically creating methods.
Traits are a little like interfaces in other languages in that they allow to define functions that are implemented by multiple different types. We will see how custom traits can be defined, what traits are built into the standard library, and how they can be automatically derived.
forloops in Rust are more powerful than you might think. In this stage, we will implement custom iterators that can then be used in regular
Generic data structures and behaviors that work with a range of concrete types are a powerful mechanism for structuring code. This stage introduces Rust's generics and how to use them.
Putting all code in one file is not great, so Rust provides modules as a way to split and organize code. We will take a look at inline modules, file-based modules, visibility specifiers and other related concepts.
Carge is Rust's build and package management tool. This part will explain the
Cargo.tomlfile, how to add dependencies to projects, and finally how to publish crates to the public crates.io package registry.
The Rust standard library provides a few APIs to interact with the file system. This stage covers reading and writing files, as well as performing other operations like copying files or creating folders.
This stage of the workshop will give a high-level overview of what macros are and how to leverage them for your own code.
Rust is great for building command line applications, not just because of the fast startup time, but also because the APIs in the standard library are well-thought-out and there are plenty of third-party crates that make developers' lives easier.
Serialization and Deserialization
In this stage we will take a look at how data can be serialized and deserialized between formats like JSON and regular Rust structs.
This section will give an introduction into building HTTP networking applications with Rust. At the end, you will have built your own simple HTTP server!
anchorCustomized to your team’s needs
We're happy to customize the workshop to precisely fit your team's needs. If you have concrete plans with Rust and are looking for guidance on specific topics, please don't hesitate to reach out to talk about what curriculum would be ideal for you and your team!