|
8 | 8 | // option. This file may not be copied, modified, or distributed
|
9 | 9 | // except according to those terms.
|
10 | 10 |
|
11 |
| -//! Vectors |
| 11 | +/*! |
| 12 | +
|
| 13 | +The `vec` module contains useful code to help work with vector values. Vectors are Rust's list |
| 14 | +type. Vectors contain zero or more values of homogeneous types: |
| 15 | +
|
| 16 | +~~~ {.rust} |
| 17 | +let int_vector = [1,2,3]; |
| 18 | +let str_vector = ["one", "two", "three"]; |
| 19 | +~~~ |
| 20 | +
|
| 21 | +This is a big module, but for a high-level overview: |
| 22 | +
|
| 23 | +## Structs |
| 24 | +
|
| 25 | +Several structs that are useful for vectors, such as `VecIterator`, which |
| 26 | +represents iteration over a vector. |
| 27 | +
|
| 28 | +## Traits |
| 29 | +
|
| 30 | +A number of traits that allow you to accomplish tasks with vectors, like the |
| 31 | +`MutableVector` and `ImmutableVector` traits. |
| 32 | +
|
| 33 | +## Implementations of other traits |
| 34 | +
|
| 35 | +Vectors are a very useful type, and so there's tons of implementations of |
| 36 | +traits found elsewhere. Some notable examples: |
| 37 | +
|
| 38 | +* `Clone` |
| 39 | +* `Iterator` |
| 40 | +* `Zero` |
| 41 | +
|
| 42 | +## Function definitions |
| 43 | +
|
| 44 | +There are a number of different functions that take vectors, here are some |
| 45 | +broad categories: |
| 46 | +
|
| 47 | +* Modifying a vector, like `append` and `grow`. |
| 48 | +* Searching in a vector, like `bsearch`. |
| 49 | +* Iterating over vectors, like `each_permutation`. |
| 50 | +* Functional transformations on vectors, like `map` and `partition`. |
| 51 | +* Stack/queue operations, like `push`/`pop` and `shift`/`unshift`. |
| 52 | +* Cons-y operations, like `head` and `tail`. |
| 53 | +* Zipper operations, like `zip` and `unzip`. |
| 54 | +
|
| 55 | +And much, much more. |
| 56 | +
|
| 57 | +*/ |
12 | 58 |
|
13 | 59 | #[warn(non_camel_case_types)];
|
14 | 60 |
|
|
0 commit comments