Skip to main content

InnerVm

Trait InnerVm 

Source
pub trait InnerVm {
    // Required methods
    fn void(&mut self, page: PageNum, num_pages: u32) -> Result<(), ApiError>;
    fn zero(&mut self, page: PageNum, num_pages: u32) -> Result<(), ApiError>;
    fn poke(&mut self, outer_src: &[u8], inner_dst: u32) -> Result<(), ApiError>;
    fn peek_into(
        &mut self,
        outer_dst: &mut [u8],
        inner_src: u32,
    ) -> Result<(), ApiError>;
    fn invoke(
        &mut self,
        gas: SignedGas,
        regs: [u64; 13],
    ) -> Result<(InvokeOutcome, SignedGas, [u64; 13]), ApiError>;
    fn expunge(self) -> Result<u64, ApiError>;

    // Provided methods
    fn zero_poke(
        &mut self,
        outer_src: &[u8],
        inner_dst: u32,
    ) -> Result<(), ApiError> { ... }
    fn poke_ro_rw_data_page(
        &mut self,
        data: &[u8],
        address_range: &Range<u32>,
        address: u32,
    ) -> Result<(), ApiError> { ... }
}
Expand description

A trait that abstracts JAM calls related to an inner VM.

Required Methods§

Source

fn void(&mut self, page: PageNum, num_pages: u32) -> Result<(), ApiError>

Source

fn zero(&mut self, page: PageNum, num_pages: u32) -> Result<(), ApiError>

Source

fn poke(&mut self, outer_src: &[u8], inner_dst: u32) -> Result<(), ApiError>

Source

fn peek_into( &mut self, outer_dst: &mut [u8], inner_src: u32, ) -> Result<(), ApiError>

Source

fn invoke( &mut self, gas: SignedGas, regs: [u64; 13], ) -> Result<(InvokeOutcome, SignedGas, [u64; 13]), ApiError>

Source

fn expunge(self) -> Result<u64, ApiError>

Provided Methods§

Source

fn zero_poke( &mut self, outer_src: &[u8], inner_dst: u32, ) -> Result<(), ApiError>

Source

fn poke_ro_rw_data_page( &mut self, data: &[u8], address_range: &Range<u32>, address: u32, ) -> Result<(), ApiError>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§