Skip to main content

StackOp

Trait StackOp 

Source
pub trait StackOp<T> {
    // Required methods
    fn push(&mut self, value: T);
    fn pop(&mut self) -> T;
    fn store(&mut self, pos: StackAddress, value: T);
    fn load(&self, pos: StackAddress) -> T;
    fn top(&self) -> T;
}
Expand description

Generic stack operations.

Required Methods§

Source

fn push(&mut self, value: T)

Push given value onto the stack.

Source

fn pop(&mut self) -> T

Pop the top value off the stack.

Source

fn store(&mut self, pos: StackAddress, value: T)

Store given value in the stack.

Source

fn load(&self, pos: StackAddress) -> T

Load a value from the stack.

Source

fn top(&self) -> T

Load the top stack value.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§