Skip to main content

Module bounded_array

Module bounded_array 

Source
Expand description

Fixed-capacity, stack-allocated array.

ExBoundedArray<T, N> stores up to N elements of type T directly on the stack without any heap allocation. The capacity is a compile-time constant; attempting to exceed it returns an error or panics, depending on the method called.

§When to Use

  • Small, short-lived buffers whose maximum size is known at compile time.
  • no_std environments without a heap.
  • Hot paths where heap-allocation overhead is unacceptable.

§SIMD Extensions (ExBoundedArray<u8, N>)

When T = u8, additional byte-level SIMD methods are available: fill_bytes, fill_range, find_byte, count_byte, extend_bytes.

Structs§

ExBoundedArray
A fixed-capacity, stack-allocated array.