Rust: Data Types
Status: Courses Tags: Rust
Data Types in Rust
- bool
- char
- Integer
- Signed - 8, 16,32,64,128 bit — represented as i8
- Unsigned - 8,16,32,64,128 bit — represented as u8
- Float - f32 f64
- Array
- Fixed - [T, N] where T is type N is number of elements
- Dynamic size - [T]
- Sequence - (T, U, ..) - Where both T and U are different types
- fn(i32) → i32 - Function type which takes i32 as input and i32 as output.