boxarray

Crates.ioboxarray
lib.rsboxarray
version1.3.1
created_at2023-09-24 02:45:09.69565+00
updated_at2025-01-05 16:57:04.722904+00
descriptionSafe way to allocate and initialize nested arrays directly on the heap in Rust.
homepagehttps://github.com/xayon40-12/boxarray.git
repositoryhttps://github.com/xayon40-12/boxarray.git
max_upload_size
id981662
size11,768
Nathan Touroux (xayon40-12)

documentation

README

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.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:?}");
}
Commit count: 26

cargo fmt