pub struct Stack<T>(/* private fields */);
Expand description
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);
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Stack<T>
impl<T> RefUnwindSafe for Stack<T>where
T: RefUnwindSafe,
impl<T> Send for Stack<T>where
T: Send,
impl<T> Sync for Stack<T>where
T: Sync,
impl<T> Unpin for Stack<T>where
T: Unpin,
impl<T> UnwindSafe for Stack<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more