[−][src]Enum rustc_expand::mbe::macro_check::Stack

pub(in mbe::macro_check) enum Stack<'a, T> {
    Empty,
    Push {
        top: T,
        prev: &'a Stack<'a, T>,
    },
}

Stack represented as linked list.

Those are used for environments because they grow incrementally and are not mutable.

Variants

Empty

Empty stack.

Push

A non-empty stack.

Fields of Push

top: T

The top element.

prev: &'a Stack<'a, T>

The previous elements.

Implementations

impl<'a, T> Stack<'a, T>[src]

pub(in mbe::macro_check) fn is_empty(
    &self
) -> bool
[src]

Returns whether a stack is empty.

pub(in mbe::macro_check) fn push(
    &'a self,
    top: T
) -> Stack<'a, T>ⓘ

Notable traits for &'a Stack<'a, T>

impl<'a, T> Iterator for &'a Stack<'a, T> type Item = &'a T;
[src]

Returns a new stack with an element of top.

Trait Implementations

impl<'_, '_> From<&'_ Stack<'_, KleeneToken>> for SmallVec<[KleeneToken; 1]>[src]

impl<'a, T> Iterator for &'a Stack<'a, T>[src]

type Item = &'a T

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for Stack<'a, T> where
    T: RefUnwindSafe, 

impl<'a, T> Send for Stack<'a, T> where
    T: Send + Sync, 

impl<'a, T> Sync for Stack<'a, T> where
    T: Sync, 

impl<'a, T> Unpin for Stack<'a, T> where
    T: Unpin, 

impl<'a, T> UnwindSafe for Stack<'a, T> where
    T: RefUnwindSafe + UnwindSafe, 

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.