2018-12-24 17:25:17 -05:00
|
|
|
|
|
|
|
pub mod vm;
|
2018-12-24 23:05:04 -05:00
|
|
|
mod backing;
|
|
|
|
mod types;
|
|
|
|
mod memory;
|
|
|
|
mod backend;
|
|
|
|
mod module;
|
|
|
|
mod instance;
|
|
|
|
mod table;
|
|
|
|
mod sig_registry;
|
|
|
|
|
|
|
|
pub use backend::Compiler;
|
|
|
|
pub use instance::{Instance, Imports, Import};
|
|
|
|
pub use module::{ModuleName, ItemName, Module};
|
|
|
|
|
|
|
|
/// Compile a webassembly module using the provided compiler and linked with the provided imports.
|
|
|
|
pub fn compile(compiler: &dyn Compiler, wasm: &[u8], imports: &Imports) -> Result<Box<Instance>, String> {
|
|
|
|
let module = compiler.compile(wasm)?;
|
|
|
|
Instance::new(module, imports)
|
|
|
|
}
|