19 releases (breaking)

Uses new Rust 2021

0.16.0-rc.0 Sep 19, 2022
0.15.0-rkyv.0 May 18, 2022
0.14.0-rc.0 Feb 23, 2022
0.11.0-rc.0 Nov 4, 2021
0.4.0 Jun 10, 2020

#149 in Data structures

Download history 78/week @ 2022-06-08 59/week @ 2022-06-15 19/week @ 2022-06-22 86/week @ 2022-06-29 64/week @ 2022-07-06 51/week @ 2022-07-13 38/week @ 2022-07-20 72/week @ 2022-07-27 88/week @ 2022-08-03 99/week @ 2022-08-10 120/week @ 2022-08-17 129/week @ 2022-08-24 62/week @ 2022-08-31 52/week @ 2022-09-07 227/week @ 2022-09-14 178/week @ 2022-09-21

532 downloads per month
Used in 5 crates (via dusk-poseidon)

MPL-2.0 and maybe GPL-3.0

20KB
451 lines

Dusk CI codecov

nstack

nstack is a stack-like merkle datastructure for storing and accessing indexed values.

Operations supported are add and remove at the end of the structure, and mutable access to indexed leaves.

Usage example

use nstack::annotation::Cardinality;
use nstack::NStack;

let mut nt = NStack::<i32, Cardinality>::new();

nt.push(0);
nt.push(1);

// mutable references to the last element
if let Some(mut branch) = nt.nth_mut(1) {
    *branch = 2;
}

assert_eq!(nt.pop(), Some(2));
assert_eq!(nt.pop(), Some(0));

lib.rs:

NStack

A stack data structure with indexed lookup.

Dependencies

~1–6MB
~100K SLoC