Docs.rs
  • static-array-0.5.0
    • static-array 0.5.0
    • Permalink
    • Docs.rs crate page
    • BSD-3-Clause
    • Links
    • Homepage
    • Repository
    • crates.io
    • Source
    • Owners
    • WhyAreAllTheseTaken
    • Dependencies
      • rayon ^1.8.1 normal optional
    • Versions
    • 100% of the crate is documented
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate static_array

static_array0.5.0

  • All Items

Sections

  • Examples
    • Creating a large array on the heap using a function.
    • Creating a large array from the default value of a type.

Crate Items

  • Structs

Crates

  • static_array

Crate static_array

Source
Expand description

A no-std rust crate providing a heap-allocated non-resizable type-checked array. The following types are provided:

  • HeapArray - A one dimensional heap-allocated array.
  • HeapArray2D - A two dimensional heap-allocated array.
  • HeapArray3D - A three dimensional heap-allocated array.

This crate does not depend on std but does require alloc in order to create the array.

§Examples

§Creating a large array on the heap using a function.

use static_array::HeapArray;

// Creates an array 16 MB (on 64 bit systems) in size which is larger than the standard linux stack size.
let array: HeapArray<usize, 2000000> = HeapArray::from_fn(|i| i);

assert_eq!(1247562, array[1247562]);

§Creating a large array from the default value of a type.

use static_array::HeapArray;

let array: HeapArray<usize, 2000000> = HeapArray::default();

assert_eq!(0, array[1247562]);

Structs§

HeapArray
A heap allocated contiguous one dimensional array. This is equivalent in layout to the type [T; N].
HeapArray2D
A heap allocated contiguous two dimensional array. This is equivalent to the type [[T; M]; N].
HeapArray3D
A heap allocated contiguous three dimensional array. This is equivalent to the type [[[T; L]; M]; N].

Results

Settings
Help

Query parser error: "Unexpected - (did you mean ->?)".