2019-01-16 18:26:10 +00:00
|
|
|
use crate::{module::ModuleInner, types::LocalFuncIndex, vm};
|
2019-01-08 17:09:47 +00:00
|
|
|
use std::ptr::NonNull;
|
|
|
|
|
2019-01-09 23:31:11 +00:00
|
|
|
pub use crate::mmap::{Mmap, Protect};
|
2019-01-11 03:59:57 +00:00
|
|
|
pub use crate::sig_registry::SigRegistry;
|
2019-01-09 23:31:11 +00:00
|
|
|
|
2019-01-08 17:09:47 +00:00
|
|
|
pub trait Compiler {
|
|
|
|
/// Compiles a `Module` from WebAssembly binary format
|
2019-01-13 03:02:19 +00:00
|
|
|
fn compile(&self, wasm: &[u8]) -> Result<ModuleInner, String>;
|
2019-01-08 17:09:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub trait FuncResolver {
|
2019-01-16 18:26:10 +00:00
|
|
|
fn get(
|
|
|
|
&self,
|
|
|
|
module: &ModuleInner,
|
|
|
|
local_func_index: LocalFuncIndex,
|
|
|
|
) -> Option<NonNull<vm::Func>>;
|
2019-01-08 17:09:47 +00:00
|
|
|
}
|