Expand description
This is a simplest and the fastest implementation of a stack on stack,
when stack elements are Copy
implementing primitives.
For example, here is how a stack can be created:
use microstack::Stack;
let mut s : Stack<u64, 10> = Stack::new();
s.push(1);
s.push(2);
assert_eq!(2, s.pop());
assert_eq!(1, s.len());
Creating a Stack
requires knowing the maximum size of it, upfront. This is
what the second type argument 10
is for, in the example above. The stack
will have exactly ten elements. An attempt to add an 11th element will lead
to a panic.