Skip to main content

Module list

Module list 

Source
Expand description

A stack or arena-allocable append-only linked list.

This is pretty good for expressing recursive algorithms which follow a stack discipline but are expressed easier with context further up the stack.

let l1 = List::new("which borrows the rest");
let l2 = l1.enter("I must construct a new node");
let l3 = l2.enter("For each new item");

// You can iterate over the items from head to tail
let mut list = Vec::from_iter(l3.iter().copied());

assert_eq!(list[..], [
    "For each new item",
    "I must construct a new node",
    "which borrows the rest",
])

Structs§

ListIter
Iterates over the items of a List from most recent to least

Enums§

List
A stack or arena-allocable append-only linked list.