https://twitter.com/mdhhht/status/1640192519769038848
bool: Represents a boolean value (true or false)char: Represents a single characterString: Owned string&str: String slicei8, i16, i32, i64: Signed integers with different bit sizesu8, u16, u32, u64: Unsigned integers with different bit sizesusize : Unsigned integer. Same number of bits as the platform's pointer typeisize : Signed integer. Same number of bits as the platform's pointer typef32, f64: Floating point numbers with different precisionarrays: Fixed-size collection of elements of the same typelet arr: [i32; 4] = [1, 2, 3, 4];
tuples: Collection of elements of different types with a fixed sizelet tup: (i32, f64, bool) = (500, 6.4, true);
HashMap: s a data structure that implements an associative array or dictionary. It is an abstract data type that maps keys to values.use std::collections::HashMap;
let solar_distance = HashMap::from([
("Mercury", 0.4),
("Venus", 0.7),
("Earth", 1.0),
("Mars", 1.5),
]);