Percorso Rust

Struct, enum e trait

Modella i dati con struct ed enum, usa il pattern matching, gestisci Option e Result e condividi il comportamento con trait e generici.

Prova Rust online

8 lezioni

Structs

Group related values into your own type with named fields.

Vedi la lezione →

Enums

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

Vedi la lezione →

Generics

Write one function or struct that works with many types.

Vedi la lezione →