mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
wasm_interp: simplified ImportDispatcher
We don't really need a trait for the 'import module' concept.
This commit is contained in:
parent
ec8950816a
commit
b10ac827f1
2 changed files with 67 additions and 85 deletions
|
@ -2,9 +2,25 @@ mod call_stack;
|
|||
mod instance;
|
||||
pub mod test_utils;
|
||||
mod value_stack;
|
||||
mod wasi;
|
||||
pub mod wasi;
|
||||
|
||||
// Main external interface
|
||||
pub use instance::Instance;
|
||||
|
||||
// Exposed for testing only. Should eventually become private.
|
||||
pub use call_stack::CallStack;
|
||||
pub use instance::{Action, Instance};
|
||||
pub use instance::Action;
|
||||
pub use value_stack::ValueStack;
|
||||
|
||||
use roc_wasm_module::Value;
|
||||
|
||||
pub trait ImportDispatcher {
|
||||
/// Dispatch a call from WebAssembly to your own code, based on module and function name.
|
||||
fn dispatch(
|
||||
&mut self,
|
||||
module_name: &str,
|
||||
function_name: &str,
|
||||
arguments: &[Value],
|
||||
memory: &mut [u8],
|
||||
) -> Option<Value>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue