Introduction
1.
Hello World
2.
Formatted print
3.
Literals and operators
4.
Variables
4.1.
Mutability
4.2.
Scope and shadowing
4.3.
Declare first
5.
Types
5.1.
Casting
5.2.
Literals
5.3.
Inference
5.4.
Alias
6.
Expressions
7.
Flow Control
7.1.
if/else
7.2.
loop
7.2.1.
Nesting and labels
7.3.
while
7.4.
for and range
7.5.
match
7.5.1.
Destructuring
7.5.1.1.
tuples
7.5.1.2.
enums
7.5.1.3.
pointers/ref
7.5.1.4.
structs
7.5.2.
Guards
7.5.3.
Binding
7.6.
if let
7.7.
while let
8.
Functions
8.1.
Unused
9.
Modules
9.1.
Visibility
9.2.
The `use` import
9.3.
`super` and `self`
9.4.
File hierarchy
10.
Crates
10.1.
Library
10.2.
`extern crate`
11.
Attributes
11.1.
Crates
11.2.
`cfg`
11.2.1.
Custom
12.
Tuples
13.
Structures
13.1.
Visibility
14.
Generics
14.1.
Implementation
14.2.
Phantom types
14.2.1.
Unit conversions
15.
Box, stack and heap
16.
RAII
17.
Ownership and moves
17.1.
Mutability
18.
Borrowing
18.1.
Mutability
18.2.
Freezing
18.3.
Aliasing
18.4.
The ref pattern
19.
Lifetimes
19.1.
The borrow checker
19.2.
Functions
19.3.
Structs
20.
Global constants
21.
Methods
22.
Enums
22.1.
C-like
23.
`panic!`
24.
`Option`
25.
Arrays and Slices
26.
Traits
26.1.
Derive
27.
Operator Overloading
28.
Bounds
29.
Drop
30.
Iterators
31.
Closures
32.
Higher Order Functions
33.
Vectors
34.
Strings
35.
Clone
36.
Threads
37.
Channels
38.
Timers
39.
Unix sockets
40.
`Result`
40.1.
`try!`
41.
Path
42.
File I/O
42.1.
`open`
42.2.
`create`
43.
Child processes
43.1.
Pipes
43.2.
Wait
44.
Filesystem Operations
45.
Benchmarking
46.
Comments
46.1.
Doc Comments
47.
Foreign Function Interface
48.
macro_rules!
48.1.
Designators
48.2.
Overload
48.3.
Repeat
48.4.
DRY
49.
Program arguments
49.1.
Argument parsing
49.2.
`getopts`
50.
SIMD
51.
Testing
52.
Unsafe operations
53.
Formatting
54.
HashMap
54.1.
Alternate/custom key types
54.2.
HashSet
Published using GitBook
A
A
Serif
Sans
White
Sepia
Night
Twitter
Google
Facebook
Weibo
Instapaper
Rust by Example
7.5.1 Destructuring
A
match
block can destructure items in a variety of ways.