diff --git a/lib/deprecated/runtime-core/doc/new-api/instance.rs b/lib/deprecated/runtime-core/doc/new-api/instance.rs index 770429a8d..4f1e25142 100644 --- a/lib/deprecated/runtime-core/doc/new-api/instance.rs +++ b/lib/deprecated/runtime-core/doc/new-api/instance.rs @@ -1,18 +1,14 @@ struct Instance { - module: Arc, exports: Exports, } impl Instance { - fn load(&self, loader: T) -> Result; - fn fun(&self, name: &str) -> ResolveResult; - fn resolve_func(&self, name: &str) -> ResolveError; - fn dyn_func(&self, name: &str) -> ResolveResult; - fn call(&self, name: &str, params: &[Value]) -> CallResult>; - fn context(&self) -> &Ctx; - fn context_mut(&mut self) -> &mut Ctx; - fn exports(&self) -> ExportsIter; + fn load(&self, _loader: T) -> Result; + fn fun(&self, name: &str) -> Result, ExportError>; + fn resolve_func(&self, name: &str) -> Result; + fn dyn_fun(&self, name: &str) -> Result; + fn call(&self, name: &str, params: &[Value]) -> Result, Box>; + fn context(&self) -> Ref; + fn context_mut(&mut self) -> RefMut; fn module(&self) -> Module; - fn get_internal(&self, fields: &InternalField) -> u64; - fn set_internal(&self, fields: &InternalField, value: u64); } diff --git a/lib/deprecated/runtime-core/doc/new-api/module.rs b/lib/deprecated/runtime-core/doc/new-api/module.rs index 2963786ec..e49c528cb 100644 --- a/lib/deprecated/runtime-core/doc/new-api/module.rs +++ b/lib/deprecated/runtime-core/doc/new-api/module.rs @@ -1,10 +1,10 @@ struct Module {} impl Module { - fn instantiate(&self, import_object: &ImportObject) -> Result; - fn cache(&self) -> Result; + fn instantiate(&self, import_object: &ImportObject) -> Result; + fn cache(&self) -> Result; fn info(&self) -> &ModuleInfo; fn imports(&self) -> Vec; fn exports(&self) -> Vec; - fn custom_sections(&self, key: impl AsRef) -> Option<&[Vec]> + fn custom_sections(&self, name: impl Asref) -> Option>>; } diff --git a/lib/deprecated/runtime-core/doc/old-api/instance.rs b/lib/deprecated/runtime-core/doc/old-api/instance.rs index 09c743e94..770429a8d 100644 --- a/lib/deprecated/runtime-core/doc/old-api/instance.rs +++ b/lib/deprecated/runtime-core/doc/old-api/instance.rs @@ -1,12 +1,18 @@ struct Instance { + module: Arc, exports: Exports, } impl Instance { - fn load(&self, _loader: T) -> Result; - fn resolve_func(&self, name: &str) -> Result; - fn call(&self, name: &str, params: &[Value]) -> Result, Box>; - fn context(&self) -> Ref; - fn context_mut(&mut self) -> RefMut; + fn load(&self, loader: T) -> Result; + fn fun(&self, name: &str) -> ResolveResult; + fn resolve_func(&self, name: &str) -> ResolveError; + fn dyn_func(&self, name: &str) -> ResolveResult; + fn call(&self, name: &str, params: &[Value]) -> CallResult>; + fn context(&self) -> &Ctx; + fn context_mut(&mut self) -> &mut Ctx; + fn exports(&self) -> ExportsIter; fn module(&self) -> Module; + fn get_internal(&self, fields: &InternalField) -> u64; + fn set_internal(&self, fields: &InternalField, value: u64); } diff --git a/lib/deprecated/runtime-core/doc/old-api/module.rs b/lib/deprecated/runtime-core/doc/old-api/module.rs index e49c528cb..2963786ec 100644 --- a/lib/deprecated/runtime-core/doc/old-api/module.rs +++ b/lib/deprecated/runtime-core/doc/old-api/module.rs @@ -1,10 +1,10 @@ struct Module {} impl Module { - fn instantiate(&self, import_object: &ImportObject) -> Result; - fn cache(&self) -> Result; + fn instantiate(&self, import_object: &ImportObject) -> Result; + fn cache(&self) -> Result; fn info(&self) -> &ModuleInfo; fn imports(&self) -> Vec; fn exports(&self) -> Vec; - fn custom_sections(&self, name: impl Asref) -> Option>>; + fn custom_sections(&self, key: impl AsRef) -> Option<&[Vec]> }