&strTYPE::&STR
STRING SLICE
A borrowed view into valid UTF-8 text.
let greeting: &str =
"Hello, Rust!";SYS.REF / 001 / RUST
UTF-8 encoded string data
STRING SLICE
A borrowed view into valid UTF-8 text.
let greeting: &str =
"Hello, Rust!";OWNED STRING
Growable, owned UTF-8 text stored on the heap.
let mut name =
String::from("Alice");Whole-number scalar values
SIGNED INTEGER
A 32-bit whole number that supports negative values.
let count: i32 = -100;UNSIGNED INTEGER
A 64-bit whole number whose minimum value is zero.
let id: u64 = 1048576;Logic, precision & characters
BOOLEAN
A logical value that is either true or false.
let is_active: bool = true;FLOAT
A double-precision IEEE 754 floating-point number.
let pi: f64 = 3.14159;UNICODE CHAR
One Unicode scalar value stored in four bytes.
let initial: char = 'R';