Struct s1vm::Stack[][src]

pub struct Stack { /* fields omitted */ }

Implementations

impl Stack[src]

pub fn new() -> Stack[src]

pub fn new_with_limit(limit: usize) -> Stack[src]

pub fn len(&self) -> usize[src]

pub fn frame_size(&self) -> usize[src]

How many values are on the current frame

pub fn push_frame(&mut self, params: usize, locals: usize) -> Trap<Frame>[src]

Start a new stack frame by saving the current base pointer.

pub fn reserve_locals(&mut self, locals: usize) -> Trap<()>[src]

pub fn pop_frame(&mut self, old_frame: Frame)[src]

Remove current stack frame and restore previous frame.

pub fn push_params(&mut self, params: &[Value]) -> Trap<usize>[src]

pub fn drop_values(&mut self, count: u32) -> Trap<()>[src]

pub fn tee_local(&mut self, local: LocalIdx) -> Trap<()>[src]

pub fn set_local(&mut self, local: LocalIdx) -> Trap<()>[src]

pub fn get_local(&mut self, local: LocalIdx) -> Trap<()>[src]

pub fn set_local_val(&mut self, local: LocalIdx, val: StackValue)[src]

pub fn get_local_val(&mut self, local: LocalIdx) -> StackValue[src]

pub fn push_val(&mut self, val: StackValue) -> Trap<()>[src]

pub fn pop_typed(&mut self, val_type: ValueType) -> Trap<Value>[src]

pub fn pop_val(&mut self) -> Trap<StackValue>[src]

pub fn top_val(&mut self) -> Trap<StackValue>[src]

pub fn unop<F>(&mut self, op: F) -> Trap<()> where
    F: FnOnce(&mut StackValue) -> Trap<()>, 
[src]

Apply a ‘unop’ to top value, replacing it with the results.

pub fn binop<F>(&mut self, op: F) -> Trap<()> where
    F: FnOnce(&mut StackValue, StackValue) -> Trap<()>, 
[src]

Apply a binop to the top two values, replacing them with the results.

Trait Implementations

impl Clone for Stack[src]

impl Debug for Stack[src]

impl Default for Stack[src]

impl FromStack<f32> for Stack[src]

impl FromStack<f64> for Stack[src]

impl FromStack<i16> for Stack[src]

impl FromStack<i32> for Stack[src]

impl FromStack<i64> for Stack[src]

impl FromStack<i8> for Stack[src]

impl FromStack<u16> for Stack[src]

impl FromStack<u32> for Stack[src]

impl FromStack<u64> for Stack[src]

impl FromStack<u8> for Stack[src]

Auto Trait Implementations

impl RefUnwindSafe for Stack

impl Send for Stack

impl Sync for Stack

impl Unpin for Stack

impl UnwindSafe for Stack

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> 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.