Rust is undeniably syntax-heavy. After all, there’s a lot of intent to express, and Rust wants you to be explicit. Still, Rust is a very elegant language. This might not be so obvious at first, as Rust has borrowed elements from a lot of precursors that help you navigating when you start, but can be false friends in the long run, resulting in bloated code, unnecessary complexity, and hard-to-use APIs.
In this workshop, we’re going to learn what Rust has to offer to create code that is a delight to read and follow, easy to use, and plays along nicely with all the other libraries out there.
We learn about:
Each chapter concludes with tasks for the audience.
Target audience: People with familiarity in Rust and basic networking (TCP, HTTP; knowing what a web-server does).
Expected workshop duration: full-day, 2-day
An example repo of using Websockets with Warp.
Solutions to the first exercises that evolve around a simple TCP chat
The example TCP chat using Tokio
Using Websockets with Axum (examples within the Axum repo)
Oliver Gould from Buoyant on why Rust is a better choice for their tasks than Go. Oliver created Linkerd based on Rust and shows which parts of the language and Tokio excite them most.
How to use Warp and Tokio to create a Websockets based chat
Tokio’s motivation behind the Service trait in Tower
An example of how you can write the Timeout Service with Tower’s Service trait and tokio::select, instead of a ResponseFuture