Rust has the following built-in primitive types:
- bool: These are the usual booleans and can be either true or false .
- char: Characters, such as e.
- Integer types: These are characterized by the bit width. Rust supports integers that are up to 128 bits wide:
| signed |
unsigned |
| i8 |
u8 |
| i16 |
u16 |
| i32 |
u32 |
| i64 |
u64 |
| i128 |
u128 |
- isize: The pointer-sized signed integer type. Equivalent to i32 on 32-bit CPU and i64 on 64-bit CPU.
- usize: The pointer-sized unsigned integer type. Equivalent to i32 on 32-bit CPU and i64 on 64-bit CPU.
- f32: The 32-bit floating point type. Implements the IEEE 754 standard for floating point representation.
- f64: The 64-bit floating point type.
- [T; N]: A fixed-size array, for the element type, T, and ...