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