Skip to main content

Module tiny_vec

Module tiny_vec 

Source
Expand description

TinyVec<T, N> — a hybrid stack/heap vector optimised for small sizes.

Up to N elements are stored inline in a fixed-size array on the stack. When the number of elements exceeds N the backing storage automatically spills onto the heap and the inline array is abandoned.

§Design goals

  • Zero heap allocation for collections that stay within N elements.
  • Transparent API that mirrors Vec<T> for push / pop / index / iter.
  • No unsafe needed for the API — the MaybeUninit usage is fully contained in this module and carefully justified.

Structs§

TinyVec
A hybrid stack/heap vector.