Rust learning path

Structs, Enums and Traits

Model data with structs and enums, match on patterns, handle Option and Result, and share behavior with traits and generics.

Try Rust online

8 lessons

Structs

Group related values into your own type with named fields.

View lesson →

Enums

Define a type that is one of several variants, each with its own data.

View lesson →

Traits

Describe shared behavior with a trait and implement it for different types.

View lesson →

Generics

Write one function or struct that works with many types.

View lesson →