mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-21 20:51:32 +00:00
Documentation and style in runtime
This commit is contained in:
@ -111,7 +111,7 @@ impl<'a> ExportIter<'a> {
|
|||||||
Self {
|
Self {
|
||||||
inner,
|
inner,
|
||||||
iter: module.exports.iter(),
|
iter: module.exports.iter(),
|
||||||
module: module,
|
module,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ pub(crate) struct InstanceInner {
|
|||||||
vmctx: Box<vm::Ctx>,
|
vmctx: Box<vm::Ctx>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A WebAssembly instance
|
||||||
pub struct Instance {
|
pub struct Instance {
|
||||||
pub module: Rc<ModuleInner>,
|
pub module: Rc<ModuleInner>,
|
||||||
inner: Box<InstanceInner>,
|
inner: Box<InstanceInner>,
|
||||||
|
@ -31,7 +31,7 @@ pub use self::instance::Instance;
|
|||||||
pub use self::module::Module;
|
pub use self::module::Module;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
/// Compile a webassembly module using the provided compiler.
|
/// Compile a WebAssembly module using the provided compiler.
|
||||||
pub fn compile(wasm: &[u8], compiler: &dyn backend::Compiler) -> CompileResult<module::Module> {
|
pub fn compile(wasm: &[u8], compiler: &dyn backend::Compiler) -> CompileResult<module::Module> {
|
||||||
compiler
|
compiler
|
||||||
.compile(wasm)
|
.compile(wasm)
|
||||||
|
@ -14,7 +14,7 @@ use crate::{
|
|||||||
use hashbrown::HashMap;
|
use hashbrown::HashMap;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
/// This is used to instantiate a new webassembly module.
|
/// This is used to instantiate a new WebAssembly module.
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub struct ModuleInner {
|
pub struct ModuleInner {
|
||||||
pub func_resolver: Box<dyn FuncResolver>,
|
pub func_resolver: Box<dyn FuncResolver>,
|
||||||
@ -47,7 +47,7 @@ impl Module {
|
|||||||
Module(inner)
|
Module(inner)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Instantiate a webassembly module with the provided imports.
|
/// Instantiate a WebAssembly module with the provided imports.
|
||||||
pub fn instantiate(&self, imports: Imports) -> Result<Instance> {
|
pub fn instantiate(&self, imports: Imports) -> Result<Instance> {
|
||||||
Instance::new(Rc::clone(&self.0), Box::new(imports))
|
Instance::new(Rc::clone(&self.0), Box::new(imports))
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user