#array #const #vector


Vec-like data structure with immutable push method

5 releases (stable)

1.1.1 Apr 12, 2023
1.1.0 Feb 14, 2023
1.0.1 Aug 29, 2019
1.0.0 Aug 27, 2019
0.1.0 Aug 27, 2019

#2072 in Data structures

21 downloads per month


323 lines

Const Vec

CI Crate informations License Documentation

This library provides a Vec-like data structure called ConstVec where elements can be pushed to the array in an immutable way as long as the capacity of the vector is large enough).


use const_vec::ConstVec;

// Create a new empty `ConstVec` with a capacity of 10 items.
// Note that it is NOT mutable.
let vec = ConstVec::new(10);

// Add a new element in `vec`, without mutating it.


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps