[][src]Trait lucet_runtime_internals::module::ModuleInternal

pub trait ModuleInternal: Send + Sync {
    fn heap_spec(&self) -> Option<&HeapSpec>;
fn globals(&self) -> &[GlobalSpec];
fn get_sparse_page_data(&self, page: usize) -> Option<&[u8]>;
fn sparse_page_data_len(&self) -> usize;
fn table_elements(&self) -> Result<&[TableElement], Error>;
fn get_export_func(&self, sym: &str) -> Result<FunctionHandle, Error>;
fn get_func_from_idx(
        &self,
        table_id: u32,
        func_id: u32
    ) -> Result<FunctionHandle, Error>;
fn get_start_func(&self) -> Result<Option<FunctionHandle>, Error>;
fn function_manifest(&self) -> &[FunctionSpec];
fn addr_details(
        &self,
        addr: *const c_void
    ) -> Result<Option<AddrDetails>, Error>;
fn get_signature(&self, fn_id: FunctionIndex) -> &Signature; fn function_handle_from_ptr(&self, ptr: FunctionPointer) -> FunctionHandle { ... }
fn lookup_trapcode(&self, rip: *const c_void) -> Option<TrapCode> { ... }
fn validate_runtime_spec(&self, limits: &Limits) -> Result<(), Error> { ... } }

Required methods

fn heap_spec(&self) -> Option<&HeapSpec>

fn globals(&self) -> &[GlobalSpec]

Get the WebAssembly globals of the module.

The indices into the returned slice correspond to the WebAssembly indices of the globals (https://webassembly.github.io/spec/core/syntax/modules.html#syntax-globalidx)

fn get_sparse_page_data(&self, page: usize) -> Option<&[u8]>

fn sparse_page_data_len(&self) -> usize

Get the number of pages in the sparse page data.

fn table_elements(&self) -> Result<&[TableElement], Error>

Get the table elements from the module.

fn get_export_func(&self, sym: &str) -> Result<FunctionHandle, Error>

fn get_func_from_idx(
    &self,
    table_id: u32,
    func_id: u32
) -> Result<FunctionHandle, Error>

fn get_start_func(&self) -> Result<Option<FunctionHandle>, Error>

fn function_manifest(&self) -> &[FunctionSpec]

fn addr_details(
    &self,
    addr: *const c_void
) -> Result<Option<AddrDetails>, Error>

fn get_signature(&self, fn_id: FunctionIndex) -> &Signature

Loading content...

Provided methods

fn function_handle_from_ptr(&self, ptr: FunctionPointer) -> FunctionHandle

fn lookup_trapcode(&self, rip: *const c_void) -> Option<TrapCode>

Look up an instruction pointer in the trap manifest.

This function must be signal-safe.

fn validate_runtime_spec(&self, limits: &Limits) -> Result<(), Error>

Check that the specifications of the WebAssembly module are valid given certain Limits.

Returns a Result<(), Error> rather than a boolean in order to provide a richer accounting of what may be invalid.

Loading content...

Implementors

Loading content...