Module rustc_data_structures::tiny_list
source · Expand description
A singly-linked list.
Using this data structure only makes sense under very specific circumstances:
- If you have a list that rarely stores more than one element, then this
data-structure can store the element without allocating and only uses as
much space as an
Option<(T, usize)>
. If T can double as theOption
discriminant, it will even only be as large asT, usize
.
If you expect to store more than 1 element in the common case, steer clear
and use a Vec<T>
, Box<[T]>
, or a SmallVec<T>
.
Structs
- Element 🔒