20 releases (breaking)

0.16.0 Oct 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

#880 in Data structures

Download history 215/week @ 2023-11-04 53/week @ 2023-11-11 51/week @ 2023-11-18 67/week @ 2023-11-25 140/week @ 2023-12-02 65/week @ 2023-12-09 53/week @ 2023-12-16 60/week @ 2023-12-23 56/week @ 2023-12-30 53/week @ 2024-01-06 83/week @ 2024-01-13 110/week @ 2024-01-20 146/week @ 2024-01-27 221/week @ 2024-02-03 401/week @ 2024-02-10 481/week @ 2024-02-17

1,278 downloads per month
Used in 2 crates (via zk-citadel)

MPL-2.0 license

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

~43KB