Primitive data types are Rust’s built-in representations of basic values, including numeric values, bytes, characters, arrays, and tuples. They form the foundation beneath structs, enums, and type aliases. section 4.5 section 4.5.1
Use the primitive families according to their representation and operational constraints:
- Choose signed or unsigned integers with explicit widths from 8 through 128 bits, such as i32 or u64. section 4.5.1
- Use usize and isize for platform-dependent sizes; standard-library length parameters commonly use usize. section 4.5.1
- Rely on checked arithmetic by default, or select checked and wrapping operations when the desired overflow behavior is explicit. section 4.5.1
Typed literals and representations
Rust permits literal suffixes and base prefixes: 0u8, 0b1u16, 0o2u32, 0x3u64, 4u128, and b’A’. Measuring these values demonstrates widths from one to sixteen bytes, while the prefixes preserve binary, octal, hexadecimal, and byte-literal intent.





