Struct Stack
struct Stack<T: Clone> { ... }
Implementation of a Stack which maintains popped elements and length of previous states
in order to rewind the stack to a previous state.
Implementations
impl<T: Clone> Stack<T>
fn new() -> SelfCreates a new
Stack.fn is_empty(self: &Self) -> boolReturns
trueif the stack is currently empty.fn peek(self: &Self) -> Option<&T>Returns the top-most
&Tin theStack.fn push(self: &mut Self, elem: T)Pushes a
Tonto theStack.fn pop(self: &mut Self) -> Option<T>Pops the top-most
Tfrom theStack.fn len(self: &Self) -> usizeReturns the size of the stack
fn snapshot(self: &mut Self)Takes a snapshot of the current
Stack.fn clear_snapshot(self: &mut Self)The parsing after the last snapshot was successful so clearing it.
fn restore(self: &mut Self)Rewinds the
Stackto the most recentsnapshot(). If nosnapshot()has been taken, this function return the stack to its initial state.
impl<T> Any for Stack<T>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Stack<T>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Stack<T>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> Freeze for Stack<T>
impl<T> From for Stack<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> RefUnwindSafe for Stack<T>
impl<T> Send for Stack<T>
impl<T> Sync for Stack<T>
impl<T> Unpin for Stack<T>
impl<T> UnsafeUnpin for Stack<T>
impl<T> UnwindSafe for Stack<T>
impl<T, U> Into for Stack<T>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Stack<T>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Stack<T>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T: $crate::fmt::Debug + Clone> Debug for Stack<T>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<T: Clone> Default for Stack<T>
fn default() -> Self
impl<T: Clone> Index for Stack<T>
fn index(self: &Self, range: Range<usize>) -> &[T]