| Crates.io | boxarray |
| lib.rs | boxarray |
| version | 1.3.1 |
| created_at | 2023-09-24 02:45:09.69565+00 |
| updated_at | 2025-01-05 16:57:04.722904+00 |
| description | Safe way to allocate and initialize nested arrays directly on the heap in Rust. |
| homepage | https://github.com/xayon40-12/boxarray.git |
| repository | https://github.com/xayon40-12/boxarray.git |
| max_upload_size | |
| id | 981662 |
| size | 11,768 |
Safe way to allocate and initialize nested arrays directly on the heap in Rust.
To use boxarray in your Rust project, simply add it as a dependency in your Cargo.toml:
[dependencies]
boxarray = "1.3.1"
Then import and use it in your project:
use boxarray::boxarray;
use boxarray::boxarray_;
fn main() {
let v = 7.0;
let a: Box<[[[f64; 3]; 2]; 4]> = boxarray(v);
println!("{a:?}");
let f = |((((), i), j), k)| (i+j*k) as usize;
let a: Box<[[[usize; 3]; 2]; 4]> = boxarray_(f);
println!("{a:?}");
}