pub trait ExtStack<'a, Ctx: Context<'a>, A: MentionableBase<'a>>: MentionableBase<'a> {
    // Required methods
    fn empty(factory: A::Fctr) -> Self;
    fn f(factory: A::Fctr) -> Self::Fctr;
    fn add(self, element: A) -> Self;
}
Expand description

Extention trait with helper methods for Stacks.

Required Methods§

source

fn empty(factory: A::Fctr) -> Self

Get an empty stack (Nullable::Null).

source

fn f(factory: A::Fctr) -> Self::Fctr

Get the corresponding factory.

source

fn add(self, element: A) -> Self

Add one element.

Note: consumes the stack. For non-consuming version do .clone() before adding.

Implementors§

source§

impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>> ExtStack<'a, Ctx, A> for Stack<'a, Ctx, A>where StackNode<'a, Ctx, A>: Mentionable<'a, Ctx, _Fctr = StackNodeFactory<Ctx, A::Fctr>>,