Rust crates: async_stream (Twitch live stream 2023-02-20)
In this video, we continued building our lastfm crate and explored how to create async iterators (streams) in tokio using the async_stream crate (https://crates.io/crates/async-stream). I also showcase how to use the Insta crate for snapshot testing (https://crates.io/crates/insta).
- Previous episodes in the series: https://youtu.be/rqUH1Dnz8Ho & https://www.youtube.com/watch?v=mrOYFegU60U
The code is available here: https://github.com/lmammino/rust-lastfm
In this episode I mentioned my article "Where to go to learn Rust": https://loige.co/where-to-go-to-learn-rust-in-2021
Chapters:
00:00:00 Intro & Recap from the last stream & my updates offline
00:10:31 Using Insta for snapshot testing
00:15:00 Looking at building an async client for Last.fm
00:17:20 Fetching pages from the Last.fm API using reqwest
00:31:10 Question: why am I learning Rust?
00:33:00 Creating a test for our client
00:35:12 Question: why Rust and not Golang?
00:38:19 Continuing with the test for our client
00:42:00 Learning how to run a specific test from the CLI :')
00:46:33 Continuing the debugging of our application
00:48:44 Iterating over different pages using the latest timestamp
00:55:30 Implementing our async iterator using async_stream
01:01:30 Using the async iterator we just created
01:09:20 Ideas for the next stream (resilience)
01:12:01 Question: Should I stick to Node.js or learn something else like Rust?
01:14:33 Question: Where should I start learning rust?
01:16:43 Closing
Huge thanks to WGaffa for the help given during this stream :)
To see the next episodes live check out our Twitch channel: https://twitch.tv/loige
Chat with me on Twitter at https://twitter.com/loige
#rust #tokio #async