Rust is a strongly typed language so it must know the data type of all variables at compile type. The Rust compiler can usually infer the variable type from the value but in cases where it can’t, a type annotation should be added otherwise “type annotations needed” compile error will be thrown. Example syntax:
let guess: u32 = "42".parse().expect("Not a number!"); //in above line u32 is type annotation
Two data type subsets: scalar and compound, this article is a summary of Scalar Types from The Rust Book.
Scalar Types
A scalar type represents a single value. There are 4 scalar types in Rust — integer, floating point numbers, Booleans, and characters.
Integer types:
unsigned integer types start with the letter u and signed integer types start with the letter i