]>
Commit | Line | Data |
---|---|---|
2c00a5a8 XL |
1 | # Conversion |
2 | ||
ba9703b0 XL |
3 | Primitive types can be converted to each other through [casting]. |
4 | ||
5 | Rust addresses conversion between custom types (i.e., `struct` and `enum`) | |
6 | by the use of [traits]. The generic | |
2c00a5a8 XL |
7 | conversions will use the [`From`] and [`Into`] traits. However there are more |
8 | specific ones for the more common cases, in particular when converting to and | |
9 | from `String`s. | |
10 | ||
ba9703b0 | 11 | [casting]: types/cast.md |
dc9dc135 | 12 | [traits]: trait.md |
2c00a5a8 XL |
13 | [`From`]: https://doc.rust-lang.org/std/convert/trait.From.html |
14 | [`Into`]: https://doc.rust-lang.org/std/convert/trait.Into.html |