Il Linguaggio di Programmazione Rust
Prefazione
Introduzione
1.
Iniziare
1.1.
Installazione
1.2.
Ciao, Mondo!
1.3.
Ciao, Cargo!
2.
Programmazione di un gioco di indovinelli
3.
Concetti Comuni di Programmazione
3.1.
Variabili e Mutabilità
3.2.
Tipi di Dati
3.3.
Funzioni
3.4.
Commenti
3.5.
Controllo del Flusso
4.
Comprendere l'Ownership
4.1.
Cos'è l'Ownership?
4.2.
Riferimenti e Borrowing
4.3.
Il tipo Slice
5.
Utilizzo di Structs per Strutturare Dati Correlati
5.1.
Definire e Instanziare le Struct
5.2.
Un programma di esempio con l'uso di Structs
5.3.
Sintassi dei metodi
6.
Enums e Pattern Matching
6.1.
Definire un Enum
6.2.
Il costrutto match
6.3.
Controllo di flusso conciso con if let
7.
Gestire Progetti in Crescita con Pacchetti, Crate, e Moduli
7.1.
Pacchetti e Crates
7.2.
Definire moduli per controllare l'ambito di visibilità e la privacy
7.3.
Percorsi per fare riferimento ad un elemento nell'albero dei moduli
7.4.
Portare i Percorsi nello Scope con la Keyword use
7.5.
Separare i Moduli in Diversi File
8.
Collezioni comuni
8.1.
Memorizzare elenchi di valori con vettori
8.2.
Memorizzazione di Testo Codificato UTF-8 con Stringhe
8.3.
Memorizzare chiavi con valori associati in Hash Map
9.
Gestione degli errori
9.1.
Errori Irrecuperabili con panic!
9.2.
Errori correggibili con Result
9.3.
To panic! or Not to panic!
10.
Tipi generici, Traits e Lifetimes
10.1.
Tipi di dati generici
10.2.
Traits: Definizione di Comportamento Condiviso
10.3.
Convalidazione dei References con le Lifetimes
11.
Writing Automated Tests
11.1.
How to Write Tests
11.2.
Controlling How Tests Are Run
11.3.
Test Organization
12.
An I/O Project: Building a Command Line Program
12.1.
Accepting Command Line Arguments
12.2.
Reading a File
12.3.
Refactoring to Improve Modularity and Error Handling
12.4.
Developing the Library’s Functionality with Test Driven Development
12.5.
Working with Environment Variables
12.6.
Writing Error Messages to Standard Error Instead of Standard Output
13.
Functional Language Features: Iterators and Closures
13.1.
Closures: Anonymous Functions that Capture Their Environment
13.2.
Processing a Series of Items with Iterators
13.3.
Improving Our I/O Project
13.4.
Comparing Performance: Loops vs. Iterators
14.
More about Cargo and Crates.io
14.1.
Customizing Builds with Release Profiles
14.2.
Publishing a Crate to Crates.io
14.3.
Cargo Workspaces
14.4.
Installing Binaries from Crates.io with cargo install
14.5.
Extending Cargo with Custom Commands
15.
Smart Pointers
15.1.
Using Box<T> to Point to Data on the Heap
15.2.
Treating Smart Pointers Like Regular References with the Deref Trait
15.3.
Running Code on Cleanup with the Drop Trait
15.4.
Rc<T>, the Reference Counted Smart Pointer
15.5.
RefCell<T> and the Interior Mutability Pattern
15.6.
Reference Cycles Can Leak Memory
16.
Fearless Concurrency
16.1.
Using Threads to Run Code Simultaneously
16.2.
Using Message Passing to Transfer Data Between Threads
16.3.
Shared-State Concurrency
16.4.
Extensible Concurrency with the Sync and Send Traits
17.
Object Oriented Programming Features of Rust
17.1.
Characteristics of Object-Oriented Languages
17.2.
Using Trait Objects That Allow for Values of Different Types
17.3.
Implementing an Object-Oriented Design Pattern
18.
Patterns and Matching
18.1.
All the Places Patterns Can Be Used
18.2.
Refutability: Whether a Pattern Might Fail to Match
18.3.
Pattern Syntax
19.
Advanced Features
19.1.
Unsafe Rust
19.2.
Advanced Traits
19.3.
Advanced Types
19.4.
Advanced Functions and Closures
19.5.
Macros
20.
Final Project: Building a Multithreaded Web Server
20.1.
Building a Single-Threaded Web Server
20.2.
Turning Our Single-Threaded Server into a Multithreaded Server
20.3.
Graceful Shutdown and Cleanup
21.
Appendix
21.1.
A - Keywords
21.2.
B - Operators and Symbols
21.3.
C - Derivable Traits
21.4.
D - Useful Development Tools
21.5.
E - Editions
21.6.
F - Translations of the Book
21.7.
G - How Rust is Made and “Nightly Rust”
Light
Rust
Coal
Navy
Ayu
Il Linguaggio di Programmazione Rust
Appendix
The following sections contain reference material you may find useful in your Rust journey.