Struct stack_vm::Stack [] [src]

pub struct Stack<T>(_);

A stack.

Supports only the most basic stack operations needed for the machine. Implemending using a Vec.

use stack_vm::Stack;
let mut stack: Stack<usize> = Stack::new();
assert!(stack.is_empty());

stack.push(13);
assert!(!stack.is_empty());

let value = stack.pop();
assert_eq!(value, 13);

Methods

impl<T: Debug> Stack<T>
[src]

[src]

Create a new empty Stack and return it.

[src]

Returns true if the stack contains no elements.

[src]

Push an element onto the top of the stack.

[src]

Pop the top element off the stack and return it.

[src]

Take a sneaky look at the top element on the stack.

[src]

Make a sneaky change to the top element on the stack.

[src]

Trait Implementations

impl<T: Debug> Debug for Stack<T>
[src]

[src]

Formats the value using the given formatter.