mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-06-23 03:31:56 +00:00
Simplified docs for interpreter::native_module() a little
This commit is contained in:
@ -253,11 +253,7 @@ impl<E: UserFunctionExecutor> ModuleInstanceInterface for NativeModuleInstance<E
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// use parity_wasm::interpreter::{CallerContext, Error, ExecutionParams, ExportEntryType,
|
/// use parity_wasm::interpreter::{CallerContext, Error, RuntimeValue, UserFunctionExecutor};
|
||||||
/// FunctionSignature, ItemIndex, ModuleInstance,
|
|
||||||
/// ModuleInstanceInterface, ProgramInstance, RuntimeValue,
|
|
||||||
/// UserDefinedElements, UserError, UserFunctionDescriptor,
|
|
||||||
/// UserFunctionExecutor};
|
|
||||||
///
|
///
|
||||||
/// struct MyExecutor;
|
/// struct MyExecutor;
|
||||||
///
|
///
|
||||||
@ -270,8 +266,8 @@ impl<E: UserFunctionExecutor> ModuleInstanceInterface for NativeModuleInstance<E
|
|||||||
/// match name {
|
/// match name {
|
||||||
/// "add" => {
|
/// "add" => {
|
||||||
/// // fn add(a: u32, b: u32) -> u32
|
/// // fn add(a: u32, b: u32) -> u32
|
||||||
/// let b = context.value_stack.pop_as::<u32>()? as u32;
|
/// let b = context.value_stack.pop_as::<u32>()?;
|
||||||
/// let a = context.value_stack.pop_as::<u32>()? as u32;
|
/// let a = context.value_stack.pop_as::<u32>()?;
|
||||||
/// let sum = a + b;
|
/// let sum = a + b;
|
||||||
/// Ok(Some(RuntimeValue::I32(sum as i32)))
|
/// Ok(Some(RuntimeValue::I32(sum as i32)))
|
||||||
/// }
|
/// }
|
||||||
|
Reference in New Issue
Block a user