Crates.io | const-vec |
lib.rs | const-vec |
version | 1.1.1 |
source | src |
created_at | 2019-08-27 12:43:38.99144 |
updated_at | 2023-04-12 11:09:30.473507 |
description | Vec-like data structure with immutable push method. |
homepage | |
repository | https://github.com/timothee-haudebourg/const-vec |
max_upload_size | |
id | 160056 |
size | 29,005 |
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.
vec.push(42);
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.