Type |
Minimum Value |
Maximum Value |
i8 |
-128 |
127 |
i16 |
-32,768 |
32,767 |
i32 |
-2,147,483,648 |
2,147,483,647 |
i64 |
-9,223,372,036,854,775,808 |
9,223,372,036,854,775,807 |
Type |
Minimum Value |
Maximum Value |
u8 |
0 |
255 |
u16 |
0 |
65,535 |
u32 |
0 |
4,294,967,295 |
u64 |
0 |
18,446,744,073,709,551,615 |
Type |
Minimum Value |
Maximum Value |
f32 |
1.175494351e-38 |
3.402823466e+38 |
f64 |
2.2250738585072014e-308 |
1.7976931348623157e+308 |
bool
: Represents a boolean value, either true
or false
.
char
: Represents a single Unicode character.
str
: Represents a string slice, which is an immutable sequence of Unicode characters.
String
: Represents a heap-allocated string, which is a growable, UTF-8 encoded string.
Vec<T>
: Represents a growable, heap-allocated array of values of type T
.
Option<T>
: Represents an optional value that may or may not be present.
Result<T, E>
: Represents the result of an operation that can either be a success value of type T
or an error value of type E
.
()
(unit): Represents an empty tuple or unit value, which has only one possible value ()
.
Box<T>
: Represents a heap-allocated, single ownership smart pointer to a value of type T
.
Rc<T>
: Represents a reference-counted smart pointer to a value of type T
that allows multiple ownership.
Arc<T>
: Represents an atomically reference-counted smart pointer to a value of type T
that allows multiple ownership across threads.
Please note that this list is not exhaustive and there may be other types in Rust that are not listed here. Always refer to the Rust documentation or the Rust standard library for accurate and up-to-date information on Rust types and their properties.