boxarray

Crates.ioboxarray
lib.rsboxarray
version1.3.0
sourcesrc
created_at2023-09-24 02:45:09.69565
updated_at2023-10-16 08:00:26.82055
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,255
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.0"

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: 23

cargo fmt