Scalar Types

0 … 255
u8
8-bit unsigned
-128 … 127
i8
8-bit signed
true, false
bool
Boolean
0 … 65535
u16
16-bit unsigned
-32768 … 32767
i16
16-bit signed
Reserved: 16-bit float
0 … 0xffffffff
u32
32-bit unsigned
i32
32-bit signed
1.0
f32
32-bit float
u64
64-bit unsigned
i64
64-bit signed
1.0
f64
64-bit float
u128
128-bit unsigned
i128
128-bit signed
Reserved: 128-bit float
array.len()
usize
Pointer-sized uint
isize
Pointer-sized int
'a', '🚀'
char
Unicode scalar

Compound Types

(0, true)
(T, U… )
Tuple
Point { x: 1, y: 2 }
struct Foo
{ … }
Struct
Some(val)
enum Foo
{ … }
Enum
union Foo
{ … }
Union
[2, 3, 5]
[T; N]
Array
()
()
Unit

Unsized Types

[T]
Unsized array slice
str
Unsized string slice
dyn Trait
Unsized trait object

&arr[i..j]
&[T]
Shared array slice
&mut arr[i..j]
&mut [T]
Mutable array slice
"text"
&str
Shared string slice
&mut str
Mutable string slice
&err as &dyn Error
&dyn Trait
Shared trait object
&mut
dyn Trait
Mutable trait object

Borrowed Reference Types

&x
&T
Shared reference
&mut x
&mut T
Mutable reference

Range Types

i..j
Range<T>
Half-open range
..j
RangeTo<T>
Bounded above
open
i..
RangeFrom<T>
Bounded below
i..=j
Range Inclusive<T>
Closed range
..=j
RangeTo Inclusive<T>
Bounded above
closed
..
RangeFull
Unbounded

Utility Types

Some(val), None
Option<T>
Option
Ok(val), Err(e)
Result<T, E>
Result
Less, Equal, Greater
Ordering
Comparison result
"x is {}"
Arguments
Precompiled
format string

Async Support Types

Pending, Ready(x)
Poll<T>
Future completion
Context<'a>
Task context
Pin<T>
Immovable
object pointer

Anonymous Types

fn foo()
Function item
|x| x > threshold
Closure
async fn foo()
Async function
async || f.await
Async closure
fn f() -> impl Trait
impl Trait
Existential type

Unsafe Support Types

UnsafeCell <T>
Interior mutability
ManuallyDrop <T>
Inhibit destructor
PhantomData <T>
Act like you own a T

Raw Pointer Types

*const T
Const raw pointer
*mut T
Mutable raw pointer

Function Pointers

foo as fn()
fn(T…) -> U
Function pointer

Panic Support

PanicInfo
Info about a panic
Location
Location of a panic

Uninhabited Type

fn exit(i32) -> !
!
Never

Access Operator Traits

x = *p
Deref
Immutable dereference
x = arr[i]
Index
Immutable index
arr[i..j]
RangeBounds
<T>
Range as index
*p = x
DerefMut
Mutable dereference
arr[i] = x
IndexMut
Mutable index

Comparison Operator Traits

x < y
PartialOrd<T>
Partial order
x == y
PartialEq<T>
Partial equivalence
Ord<T>
Total order
Eq<T>
Equivalence

Arithmetic Operator Traits

x + y
Add<T>
Addition
x - y
Sub<T>
Subtraction
x * y
Mul<T>
Multiplication
x / y
Div<T>
Division
x % y
Rem<T>
Remainder
-x
Neg
Negation
x += y
AddAssign<T>
Addition
assignment
x -= y
SubAssign<T>
Subtraction
assignment
x *= y
MulAssign<T>
Multiplication
assignment
x /= y
DivAssign<T>
Division
assignment
x %= y
RemAssign<T>
Remainder
assignment

Bitwise Operator Traits

x & y
BitAnd<T>
Bitwise AND
x | y
BitOr<T>
Bitwise OR
x ^ y
BitXor<T>
Bitwise XOR
x << y
Shl<T>
Shift left
x >> y
Shr<T>
Shift right
!x
Not
Bitwise NOT
x &= y
BitAndAssign
<T>
Bitwise AND
assignment
x |= y
BitOrAssign
<T>
Bitwise OR
assignment
x ^= y
BitXorAssign
<T>
Bitwise XOR
assignment
x <<= y
ShlAssign
<T>
Shift left
assignment
x >>= y
ShrAssign
<T>
Shift right
assignment

Callable Traits

move || s
FnOnce(T…)
-> U
Callable if owned
|| x += 1
FnMut(T…)
-> U
Callable if mutable
|x| x + 1
Fn(T…)
-> U
Callable while shared
Async
FnOnce(T…)
-> U
Async closure
callable if owned
Async
FnMut(T…)
-> U
Async closure
callable if mutable
Async
Fn(T…)
-> U
Async closure
callable while shared

Memory Management Traits

T: ?Sized
Sized
Size is const
Copy
Implicit duplication
Drop
Custom destructor
Clone
Explicit duplication

Iteration Traits

for x in 0..10
Iterator
Iterator
for x in [2, 3, 5]
IntoIterator
Convert to iterator

Thread Safety Traits

Send
Cross thread boundary
Sync
Share across threads

Async Support Traits

foo().await
Future
Async computation
Unpin
Future not needing Pin

Panic Support Traits

UnwindSafe
Panic-safe types
RefUnwindSafe
Helper for UnwindSafe

Termination Trait

Termination
Return types from main

Types


Traits

RustCurious.com

Elements of Rust – Core Types and Traits

A clickable visual guide to the Rust type system. Every type possible in Rust falls into one of the boxes shown.

The focus here is on lang_items – types and traits built into the language to support specific syntax. The purpose is to demystify what can be built purely in library code. For example, Vec, String and HashMap do not appear here because those are just structs. Rust's clear delineation of a platform-independent core enables no_std crates in embedded firmware and other systems-level contexts where no dynamic heap is available. (discussion)

Ben Williamson, 2025