boxarray 1.2.1

Safe way to allocate and initialize nested arrays directly on the heap in Rust.
Documentation

boxarray

GitHub Workflow Status Crates.io Docs.rs

Safe way to allocate and initialize nested arrays directly on the heap in Rust.

Usage

To use boxarray in your Rust project, simply add it as a dependency in your Cargo.toml:

[dependencies]
boxarray = "1.2.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:?}");
}