astack.rs
astack offers a Stack
data structure with fixed capacity capable of fast LIFO operations.
The crate is available in both std and non-std environments. It does not even require the alloc
crate.
A Stack
does not allow for indexing operations, but offers three ways to operate with the top of the stack:
- Checked methods, such as
pop
andpush
: perform the operation and return anOption
/Result
if it does not succeed. - Panicking methods, such as
pop_panicking
andpush_panicking
: perform the operation and panic if it does not succeed. - Unchecked methods, such as
pop_unchecked
andpush_unchecked
: perform the operation but cause undefined behavior if it does not succeed.
Examples
use stack;
License
Licensed under MIT license or Apache Licence 2.0