Types
Types
Every variable, item and value in a Rust program has a type. The type of a value defines the interpretation of the memory holding it.
Built-in types are tightly integrated into the language, in nontrivial ways that are not possible to emulate in user-defined types. User-defined types have limited capabilities.
Primitive types
- Some types are defined by the language, rather than as part of the standard library, these are called primitive types. Some of these are individual types:
- The boolean type bool with values true and false.
- The machine types (integer and floating-point).
- The machine-dependent integer types.
- The textual types char and str.
- There are also some primitive constructs for generic types built in to the language:
- Tuples
- Arrays
- Slices
- Function pointers
- References
- Pointers