A stack for rust trait objects that minimizes allocations
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
benches
src
.gitignore
Cargo.toml
LICENSE
README.md

README.md

dynstack

A stack for trait objects that minimizes allocations

Usage

dynstack can mostly replace anywhere you'd use a stack, or a vector that doesn't require removal from its center.

let mut stack = DynStack::<Debug>::new();
dyn_push!(stack, "hello, world!");
dyn_push!(stack, 0usize);
dyn_push!(stack, [1, 2, 3, 4, 5, 6]);

for item in stack.iter() {
    println!("{:?}", item);
}

// prints:
//  "hello, world!"
//  0
//  [1, 2, 3, 4, 5, 6]