wasmer/lib/runtime/src/lib.rs
Lachlan Sneff 8a9f5fa61a
Add special error types for compile, linking, and runtime errors. (#99)
* Add error types and convert most results to wasmer-runtime results

* Fix spectests

* Fix umbrella project to work with new error types
2019-01-18 10:54:16 -08:00

40 lines
791 B
Rust

#[cfg(test)]
#[macro_use]
extern crate field_offset;
#[macro_use]
pub mod macros;
#[doc(hidden)]
pub mod backend;
mod backing;
pub mod error;
pub mod export;
pub mod import;
pub mod instance;
pub mod memory;
mod mmap;
pub mod module;
mod recovery;
mod sig_registry;
mod sighandler;
pub mod structures;
pub mod table;
pub mod types;
pub mod vm;
#[doc(hidden)]
pub mod vmcalls;
use self::error::CompileResult;
pub use self::instance::Instance;
#[doc(inline)]
pub use self::module::Module;
pub use self::error::Result;
use std::rc::Rc;
/// Compile a webassembly module using the provided compiler.
pub fn compile(wasm: &[u8], compiler: &dyn backend::Compiler) -> CompileResult<module::Module> {
compiler
.compile(wasm)
.map(|inner| module::Module::new(Rc::new(inner)))
}