Trilha de Rust

Structs, enums e traits

Modele dados com structs e enums, use pattern matching, trate Option e Result e compartilhe comportamento com traits e genéricos.

Experimentar Rust online

8 lições

Structs

Group related values into your own type with named fields.

Ver lição →

Enums

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

Ver lição →

Traits

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

Ver lição →

Generics

Write one function or struct that works with many types.

Ver lição →