# 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.
# Examples
```rust
use astack::stack;
fn main() {
// Create an empty stack of i32 with can hold up to 8 numbers.
let mut stack = stack![i32; 8];
// Push an item to the end of the stack.
// Returns Err if the stack is full.
stack.push(10).unwrap();
stack.push(20).unwrap();
// Pop the top of the stack. Returns None if the stack is empty.
assert_eq!(stack.pop(), Some(20));
// Get a reference to TOS with Stack::tos.
// Get a mutable reference to TOS with Stack::tos_mut.
assert_eq!(stack.tos(), Some(&10));
// Remove all the elements from the stack
stack.clear();
assert!(stack.is_empty());
}
```
# License
Licensed under [MIT license](https://opensource.org/license/mit/) or [Apache Licence 2.0](https://www.apache.org/licenses/LICENSE-2.0)