Enum nstack::NStack[][src]

pub enum NStack<T, A> {
    Leaf([Option<T>; 4]),
    Node([Option<Annotated<NStack<T, A>, A>>; 4]),
}

Variants

Leaf([Option<T>; 4])
Node([Option<Annotated<NStack<T, A>, A>>; 4])

Implementations

impl<T, A> NStack<T, A> where
    Self: Compound<A>,
    T: Canon,
    A: Canon + Combine<Self, A>, 
[src]

pub fn new() -> Self[src]

Creates a new empty NStack

pub fn push(&mut self, t: T) -> Result<(), CanonError>[src]

Pushes a new element onto the stack

pub fn pop(&mut self) -> Result<Option<T>, CanonError>[src]

Pop an element off the stack.

Returns the popped element, if any.

Trait Implementations

impl<T: Canon, A: Canon> Canon for NStack<T, A>[src]

impl<T: Clone, A: Clone> Clone for NStack<T, A>[src]

impl<T, A> Compound<A> for NStack<T, A> where
    T: Canon,
    A: Canon
[src]

type Leaf = T

The leaf type of the Compound collection

impl<T: Debug, A: Debug> Debug for NStack<T, A>[src]

impl<T, A> Default for NStack<T, A>[src]

impl<T, A> MutableLeaves for NStack<T, A>[src]

Auto Trait Implementations

impl<T, A> !RefUnwindSafe for NStack<T, A>

impl<T, A> !Send for NStack<T, A>

impl<T, A> !Sync for NStack<T, A>

impl<T, A> Unpin for NStack<T, A> where
    T: Unpin

impl<T, A> !UnwindSafe for NStack<T, A>

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> EncodeToVec for T where
    T: Canon
[src]

impl<'a, C, A> First<'a, A> for C where
    C: Compound<A> + Clone,
    A: Combine<C, A>, 
[src]

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

impl<'a, C, A, K> GetMaxKey<'a, A, K> for C where
    C: Compound<A> + Clone,
    A: Combine<C, A> + Borrow<MaxKey<K>>,
    K: Ord + Clone + Debug,
    <C as Compound<A>>::Leaf: Keyed<K>, 
[src]

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

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

impl<'a, C, A> Nth<'a, A> for C where
    C: Compound<A> + Clone,
    A: Combine<C, A> + Borrow<Cardinality>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.