Module rustc_data_structures::tiny_list [−][src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
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 a
Option<(T, usize)>. If T can double as theOptiondiscriminant, 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>.
Re-exports
use std::mem; |
Structs
| Element |
[ Experimental ]
|
| TinyList |
[ Experimental ]
|