Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Rust: Data Types

Status: Courses Tags: Rust

Data Types in Rust

  1. bool
  2. char
  3. Integer
    1. Signed - 8, 16,32,64,128 bit — represented as i8
    2. Unsigned - 8,16,32,64,128 bit — represented as u8
  4. Float - f32 f64
  5. Array
    1. Fixed - [T, N] where T is type N is number of elements
    2. Dynamic size - [T]
  6. Sequence - (T, U, ..) - Where both T and U are different types
  7. fn(i32) → i32 - Function type which takes i32 as input and i32 as output.