Conceptual
Login

Variables, Mutability, and Basic Types in Rust

In Rust every value has a type known at compile time, and every variable is read-only unless you mark it mutable. Number types state their exact width and sign, like a 32-bit unsigned integer, so you always know how many bits you are moving. This is what lets you write code that matches a hardware register exactly instead of hoping the compiler picked the right size.

Questions this Concept answers

  • Why does Rust name integer widths explicitly, writing `u32` rather than a generic integer keyword?