mirror of
https://github.com/fluencelabs/marine.git
synced 2025-06-24 12:11:38 +00:00
New mounted binaries interface (#64)
This commit is contained in:
@ -17,7 +17,7 @@
|
||||
use super::wit_prelude::*;
|
||||
use super::fce_module::FCEModule;
|
||||
use super::IRecordType;
|
||||
use crate::Result;
|
||||
use crate::FCEResult;
|
||||
|
||||
use fce_wit_interfaces::FCEWITInterfaces;
|
||||
use fce_wit_interfaces::WITAstType;
|
||||
@ -48,7 +48,7 @@ impl WITInstance {
|
||||
wasmer_instance: &WasmerInstance,
|
||||
wit: &FCEWITInterfaces<'_>,
|
||||
modules: &HashMap<String, FCEModule>,
|
||||
) -> Result<Self> {
|
||||
) -> FCEResult<Self> {
|
||||
let mut exports = Self::extract_raw_exports(&wasmer_instance, wit)?;
|
||||
let imports = Self::extract_imports(modules, wit, exports.len())?;
|
||||
let memories = Self::extract_memories(&wasmer_instance);
|
||||
@ -68,7 +68,7 @@ impl WITInstance {
|
||||
fn extract_raw_exports(
|
||||
wasmer_instance: &WasmerInstance,
|
||||
wit: &FCEWITInterfaces<'_>,
|
||||
) -> Result<HashMap<usize, WITFunction>> {
|
||||
) -> FCEResult<HashMap<usize, WITFunction>> {
|
||||
use wasmer_core::DynFunc;
|
||||
|
||||
let module_exports = &wasmer_instance.exports;
|
||||
@ -96,7 +96,7 @@ impl WITInstance {
|
||||
modules: &HashMap<String, FCEModule>,
|
||||
wit: &FCEWITInterfaces<'_>,
|
||||
start_index: usize,
|
||||
) -> Result<HashMap<usize, WITFunction>> {
|
||||
) -> FCEResult<HashMap<usize, WITFunction>> {
|
||||
wit.imports()
|
||||
.filter(|import|
|
||||
// filter out imports that have implementations
|
||||
@ -129,7 +129,7 @@ impl WITInstance {
|
||||
import.namespace
|
||||
))),
|
||||
})
|
||||
.collect::<Result<HashMap<_, _>>>()
|
||||
.collect::<FCEResult<HashMap<_, _>>>()
|
||||
}
|
||||
|
||||
fn extract_memories(wasmer_instance: &WasmerInstance) -> Vec<WITMemory> {
|
||||
|
Reference in New Issue
Block a user