Introduction
1.
Привет, мир!
1.1.
Комментарии
1.2.
Форматированный вывод
1.2.1.
Debug
1.2.2.
Display
1.2.2.1.
Тест: Список
1.2.3.
Форматирование
2.
Примитивы
2.1.
Литералов и операторы
2.2.
Кортежи
2.3.
Массив и Срезы
3.
Пользовательские типы
3.1.
Структуры
3.2.
Перечисления
3.2.1.
use
3.2.2.
C-подобные
3.2.3.
Testcase: linked-list
3.3.
константы
4.
Связывание переменных
4.1.
Изменяемость
4.2.
Область видимость
4.3.
Предварительное объявление
5.
Преобразование типов
5.1.
Литералы
5.2.
Вывод типов
5.3.
Псевдонимы
6.
Выражения
7.
Управление потоком
7.1.
if/else
7.2.
loop
7.2.1.
Вложенность и метки
7.3.
while
7.4.
for and range
7.5.
match
7.5.1.
Деструктуризация
7.5.1.1.
Кортежи
7.5.1.2.
enums
7.5.1.3.
pointers/ref
7.5.1.4.
structs
7.5.2.
Ограничитель шаблонов
7.5.3.
Binding
7.6.
if let
7.7.
while let
8.
Функции
8.1.
Методы
8.2.
Замыкания
8.2.1.
Capturing
8.2.2.
As input parameters
8.2.3.
Type anonymity
8.2.4.
Input functions
8.2.5.
As output parameters
8.2.6.
Examples in `std`
8.2.6.1.
Iterator::any
8.2.6.2.
Iterator::find
8.3.
Функции Высшего Порядка
9.
Модули
9.1.
Видимость
9.2.
Struct visibility
9.3.
Декларация `use`
9.4.
`super` and `self`
9.5.
Иерархия файлов
10.
Контейнеры
10.1.
Библиотеки
10.2.
`extern crate`
11.
Атрибуты
11.1.
`Мертвый код`
11.2.
Контейнеры
11.3.
Условные атрибуты
11.3.1.
Собственные условия
12.
Generics
12.1.
Functions
12.2.
Реализация
12.3.
Traits
12.4.
Bounds
12.4.1.
Testcase: empty bounds
12.5.
Multiple bounds
12.6.
Where clauses
12.7.
Associated items
12.7.1.
The Problem
12.7.2.
Associated types
12.8.
Phantom type parameters
12.8.1.
Testcase: unit clarification
13.
Scoping rules
13.1.
RAII
13.2.
Ownership and moves
13.2.1.
Mutability
13.3.
Borrowing
13.3.1.
Mutability
13.3.2.
Freezing
13.3.3.
Aliasing
13.3.4.
The ref pattern
13.4.
Lifetimes
13.4.1.
Explicit annotation
13.4.2.
Functions
13.4.3.
Methods
13.4.4.
Structs
13.4.5.
Bounds
13.4.6.
Coercion
13.4.7.
static
13.4.8.
elision
14.
Traits
14.1.
Derive
14.2.
Operator Overloading
14.3.
Drop
14.4.
Iterators
14.5.
Clone
15.
macro_rules!
15.1.
Designators
15.2.
Overload
15.3.
Repeat
15.4.
DRY (Don't Repeat Yourself)
16.
Error handling
16.1.
`panic`
16.2.
`Option` & `unwrap`
16.2.1.
Combinators: `map`
16.2.2.
Combinators: `and_then`
16.3.
`Result`
16.3.1.
`map` for `Result`
16.3.2.
aliases for `Result`
16.4.
Multiple error types
16.4.1.
Early returns
16.4.2.
Introducing `try!`
16.5.
Defining an error type
16.6.
Other uses of `try!`
16.7.
`Box`ing errors
17.
Std library types
17.1.
Упаковка, стек и куча
17.2.
Вектора
17.3.
Strings
17.4.
`Option`
17.5.
`Result`
17.5.1.
`try!`
17.6.
`panic!`
17.7.
HashMap
17.7.1.
Alternate/custom key types
17.7.2.
HashSet
18.
Разное в стандартной библиотеке
18.1.
Потоки
18.2.
Channels
18.3.
Path
18.4.
File I/O
18.4.1.
`open`
18.4.2.
`create`
18.5.
Child processes
18.5.1.
Pipes
18.5.2.
Wait
18.6.
Filesystem Operations
18.7.
Program arguments
18.7.1.
Argument parsing
18.8.
Foreign Function Interface
19.
Meta
19.1.
Documentation
19.2.
Testing
20.
Unsafe operations
Published using GitBook
A
A
Serif
Sans
White
Sepia
Night
Twitter
Google
Facebook
Weibo
Instapaper
Rust на примерах
8.2.6 Examples in
std
This section contains a few examples of using closures from the
std
library.