Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Rust Programming Tutorial #10 – Enum Types

40.3K views on YouTube

dcode 42 tutorials here

Reference and documentation for Rust:
https://doc.rust-lang.org/book/second-edition/ch06-01-defining-an-enum.html

Refer to the above to find out how you can store data in variations.

Today we look at Enum Types in Rust – Enums provide a way to express your code in a descriptive and simple way. For example, when dealing with directions of a player in a game you might want to store all their possible directions in an Enum, having the variants Up, Down, Left and Right.

If this video helped you out and you’d like to see more, make sure to leave a like and subscribe to dcode!