Skip to content

vihaco_module::host

host

vihaco_module::host

classFrameMemorysource

vihaco_module::host::FrameMemory

Rust trait.

pub trait FrameMemory: StackFrame + StackMemory
source

methodframe_basesource

vihaco_module::host::FrameMemory::frame_base

fn frame_base(&self) -> Result<usize>

Returns

Result<usize>

source

methodget_localsource

vihaco_module::host::FrameMemory::get_local

fn get_local(&self, index: usize) -> Result<&<Self as >::Value>

Parameters

NameTypeDescription
indexusize

Returns

Result<&<Self as >::Value>

source

methodget_local_mutsource

vihaco_module::host::FrameMemory::get_local_mut

Signature
fn get_local_mut(&mut self, index: usize) -> Result<&mut <Self as >::Value>

Parameters

NameTypeDescription
indexusize

Returns

Result<&mut <Self as >::Value>

source

classGetProgramInfosource

vihaco_module::host::GetProgramInfo

Rust trait.

pub trait GetProgramInfo

Associated items

NameTypeDescription
Typetype Typeassociated type
Valuetype Valueassociated type
source

methodget_constantsource

vihaco_module::host::GetProgramInfo::get_constant

fn get_constant(&self, id: ConstantId) -> Result<&<Self as >::Value>

Parameters

NameTypeDescription
idConstantId

Returns

Result<&<Self as >::Value>

source

methodget_functionsource

vihaco_module::host::GetProgramInfo::get_function

Signature
fn get_function(&self, index: usize) -> Result<FunctionInfo<<Self as >::Type>>

Parameters

NameTypeDescription
indexusize

Returns

Result<FunctionInfo<<Self as >::Type>>

source

methodget_stringsource

vihaco_module::host::GetProgramInfo::get_string

fn get_string(&self, index: usize) -> Result<&String>

Parameters

NameTypeDescription
indexusize

Returns

Result<&String>

source

classProgramCountersource

vihaco_module::host::ProgramCounter

Rust trait.

pub trait ProgramCounter

Associated items

NameTypeDescription
Instructiontype Instructionassociated type
source

methodget_instructionsource

vihaco_module::host::ProgramCounter::get_instruction

fn get_instruction(&self, pc: u32) -> Result<&<Self as >::Instruction>

Parameters

NameTypeDescription
pcu32

Returns

Result<&<Self as >::Instruction>

Get the instruction at the given program counter without advancing it.

source

methodnext_instructionsource

vihaco_module::host::ProgramCounter::next_instruction

fn next_instruction(&mut self) -> Result<&<Self as >::Instruction>

Returns

Result<&<Self as >::Instruction>

Get the current instruction and advance the program counter by 1.

source

methodpcsource

vihaco_module::host::ProgramCounter::pc

fn pc(&self) -> u32

Returns

u32

Get the current program counter.

source

methodpc_mutsource

vihaco_module::host::ProgramCounter::pc_mut

fn pc_mut(&mut self) -> &mut u32

Returns

&mut u32

Get a mutable reference to the program counter.

source

methodpeek_instructionsource

vihaco_module::host::ProgramCounter::peek_instruction

fn peek_instruction(&self) -> Result<&<Self as >::Instruction>

Returns

Result<&<Self as >::Instruction>

Peek the current instruction without advancing the program counter.

source

classStackFramesource

vihaco_module::host::StackFrame

Rust trait.

pub trait StackFrame
source

methodget_framesource

vihaco_module::host::StackFrame::get_frame

fn get_frame(&self) -> Result<&Frame>

Returns

Result<&Frame>

source

methodget_frame_mutsource

vihaco_module::host::StackFrame::get_frame_mut

fn get_frame_mut(&mut self) -> Result<&mut Frame>

Returns

Result<&mut Frame>

source

methodpop_framesource

vihaco_module::host::StackFrame::pop_frame

fn pop_frame(&mut self) -> Result<Frame>

Returns

Result<Frame>

source

methodpush_framesource

vihaco_module::host::StackFrame::push_frame

fn push_frame(&mut self, frame: Frame)

Parameters

NameTypeDescription
frameFrame
source

classStackMemorysource

vihaco_module::host::StackMemory

Rust trait.

pub trait StackMemory

Associated items

NameTypeDescription
Valuetype Valueassociated type
source

methodstacksource

vihaco_module::host::StackMemory::stack

fn stack(&self) -> &Vec<<Self as >::Value>

Returns

&Vec<<Self as >::Value>

source

methodstack_getsource

vihaco_module::host::StackMemory::stack_get

fn stack_get(&self, pos: usize) -> Result<&<Self as >::Value>

Parameters

NameTypeDescription
posusize

Returns

Result<&<Self as >::Value>

source

methodstack_get_mutsource

vihaco_module::host::StackMemory::stack_get_mut

Signature
fn stack_get_mut(&mut self, pos: usize) -> Result<&mut <Self as >::Value>

Parameters

NameTypeDescription
posusize

Returns

Result<&mut <Self as >::Value>

source

methodstack_is_emptysource

vihaco_module::host::StackMemory::stack_is_empty

fn stack_is_empty(&self) -> bool

Returns

bool

source

methodstack_lensource

vihaco_module::host::StackMemory::stack_len

fn stack_len(&self) -> usize

Returns

usize

source

methodstack_mutsource

vihaco_module::host::StackMemory::stack_mut

fn stack_mut(&mut self) -> &mut Vec<<Self as >::Value>

Returns

&mut Vec<<Self as >::Value>

source

methodstack_popsource

vihaco_module::host::StackMemory::stack_pop

fn stack_pop(&mut self) -> Result<<Self as >::Value>

Returns

Result<<Self as >::Value>

source

methodstack_pushsource

vihaco_module::host::StackMemory::stack_push

fn stack_push<T: Into<<Self as >::Value>>(&mut self, v: T)

Parameters

NameTypeDescription
vT
source

methodstack_topsource

vihaco_module::host::StackMemory::stack_top

fn stack_top(&self) -> Result<&<Self as >::Value>

Returns

Result<&<Self as >::Value>

source

methodstack_top_mutsource

vihaco_module::host::StackMemory::stack_top_mut

fn stack_top_mut(&mut self) -> Result<&mut <Self as >::Value>

Returns

Result<&mut <Self as >::Value>

source

classStdoutsource

vihaco_module::host::Stdout

Rust trait.

pub trait Stdout

Associated items

NameTypeDescription
Outputtype Output: Read + Writeassociated type
source

methodstdoutsource

vihaco_module::host::Stdout::stdout

fn stdout(&self) -> &<Self as >::Output

Returns

&<Self as >::Output

source

methodstdout_mutsource

vihaco_module::host::Stdout::stdout_mut

fn stdout_mut(&mut self) -> &mut <Self as >::Output

Returns

&mut <Self as >::Output

source