Skip to main content

Crate arrlist

Crate arrlist 

Source
Expand description

§arrlist

A generic, heap-allocated dynamic array for no_std environments.

ArrayList<T> is a contiguous, growable collection backed by a boxed slice of MaybeUninit<T>. It provides O(1) amortized push/pop at the back, O(n) insertion and removal at arbitrary positions, and a full set of iterator types — all without requiring the standard library.

§Features

§Quick Start

use arrlist::{arrlist, ArrayList};

// Using the macro — just like vec![]
let list = arrlist![1, 2, 3];
assert_eq!(list.len(), 3);
assert_eq!(list.get(1), Some(&2));

// Or create an empty list with a given capacity: arrlist![0; 8]
let list: ArrayList<i32> = arrlist![0; 8];
assert_eq!(list.capacity(), 8);
assert_eq!(list.len(), 8);

Modules§

error
Error types for fallible ArrayList operations.

Macros§

arrlist
Creates an ArrayList with the given elements, mirroring the syntax of the standard vec! macro.

Structs§

ArrayList
Core ArrayList<T> data structure. A heap-allocated, dynamically-sized list backed by a contiguous block of memory.
IntoIter
An owning iterator over an ArrayList<T>.
Iter
A borrowing iterator over an ArrayList<T> that yields shared references.
IterMut
A mutably-borrowing iterator over an ArrayList<T> that yields exclusive references.