[][src]Trait wasmer_interface_types_fl::interpreter::stack::Stackable

pub trait Stackable {
    type Item;
    pub fn is_empty(&self) -> bool;
pub fn as_slice(&self) -> &[Self::Item];
pub fn push(&mut self, item: Self::Item);
pub fn pop1(&mut self) -> Option<Self::Item>;
pub fn pop(&mut self, n: usize) -> Option<Vec<Self::Item>>;
pub fn peek1(&self) -> Option<&Self::Item>; }

The Stackable trait represents a small basic set of operations required by the interpreter.

Associated Types

type Item[src]

The kind of item the stack holds.

Loading content...

Required methods

pub fn is_empty(&self) -> bool[src]

Checks whether the stack is empty.

pub fn as_slice(&self) -> &[Self::Item][src]

Extracts a slice containing the entire stack.

pub fn push(&mut self, item: Self::Item)[src]

Appends one item to the end of the stack.

pub fn pop1(&mut self) -> Option<Self::Item>[src]

Removes the last item of the stack and returns it, None if the stack is empty.

pub fn pop(&mut self, n: usize) -> Option<Vec<Self::Item>>[src]

Removes n elements from the end of the stack, None if the stack doesn't contain enough elements. Returned items are in reverse order: the last element comes last in the list.

pub fn peek1(&self) -> Option<&Self::Item>[src]

Peek the last item of the stack and returns a reference to it, None if the stack is empty.

Loading content...

Implementors

impl<T> Stackable for Stack<T> where
    T: Default + Clone
[src]

type Item = T

Loading content...