Crate build_array

Source
Expand description

Build an array dynamically without heap allocations, deferring errors to a single build callsite.

let arr: [u8; 3] = ArrayBuilder::new()
    .push(1)
    .push(2)
    .push(3)
    .build_exact()
    .unwrap();

assert_eq!(arr, [1, 2, 3]);

You can choose how to handle the wrong number of push calls:

§Comparison with other libraries

Structs§

ArrayBuilder
Build an array dynamically without heap allocations.
Error
Error when building an array from ArrayBuilder.

Functions§

new
Shorthand for ArrayBuilder::new.