2019-01-08 17:09:47 +00:00
|
|
|
#[macro_use]
|
|
|
|
mod macros;
|
|
|
|
mod backend;
|
|
|
|
mod backing;
|
|
|
|
mod instance;
|
|
|
|
mod memory;
|
2019-01-08 21:04:03 +00:00
|
|
|
pub mod mmap;
|
|
|
|
pub mod module;
|
2019-01-09 02:57:28 +00:00
|
|
|
mod recovery;
|
|
|
|
mod sig_registry;
|
|
|
|
mod sighandler;
|
|
|
|
mod table;
|
2019-01-08 17:09:47 +00:00
|
|
|
pub mod types;
|
|
|
|
pub mod vm;
|
|
|
|
pub mod vmcalls;
|
|
|
|
|
|
|
|
pub use self::backend::{Compiler, FuncResolver};
|
|
|
|
pub use self::instance::{Import, ImportResolver, Imports, Instance};
|
2019-01-09 02:57:28 +00:00
|
|
|
pub use self::memory::LinearMemory;
|
2019-01-08 21:04:03 +00:00
|
|
|
pub use self::module::{Module, ModuleInner};
|
2019-01-08 17:09:47 +00:00
|
|
|
pub use self::sig_registry::SigRegistry;
|
|
|
|
|
|
|
|
/// Compile a webassembly module using the provided compiler.
|
2019-01-09 02:57:28 +00:00
|
|
|
pub fn compile(wasm: &[u8], compiler: &dyn Compiler) -> Result<Module, String> {
|
2019-01-08 17:09:47 +00:00
|
|
|
compiler.compile(wasm)
|
2019-01-09 02:57:28 +00:00
|
|
|
}
|