Trait ModuleInternal

Source
pub trait ModuleInternal: Send + Sync {
Show 15 methods // Required methods fn is_instruction_count_instrumented(&self) -> bool; 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; // Provided methods 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§

Source

fn is_instruction_count_instrumented(&self) -> bool

Determine whether this module has been instrumented with additional instructions that monitor the number of wasm operations executed during runtime.

Source

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

Source

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)

Source

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

Source

fn sparse_page_data_len(&self) -> usize

Get the number of pages in the sparse page data.

Source

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

Get the table elements from the module.

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Provided Methods§

Source

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

Source

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.

Source

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.

Implementors§