diff --git a/lib/deprecated/runtime-core/doc/new-api/instance.rs b/lib/deprecated/runtime-core/doc/new-api/instance.rs new file mode 100644 index 000000000..770429a8d --- /dev/null +++ b/lib/deprecated/runtime-core/doc/new-api/instance.rs @@ -0,0 +1,18 @@ +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 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 new file mode 100644 index 000000000..2963786ec --- /dev/null +++ b/lib/deprecated/runtime-core/doc/new-api/module.rs @@ -0,0 +1,10 @@ +struct Module {} + +impl Module { + 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]> +} diff --git a/lib/deprecated/runtime-core/doc/old-api/instance.rs b/lib/deprecated/runtime-core/doc/old-api/instance.rs new file mode 100644 index 000000000..09c743e94 --- /dev/null +++ b/lib/deprecated/runtime-core/doc/old-api/instance.rs @@ -0,0 +1,12 @@ +struct Instance { + 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 module(&self) -> Module; +} diff --git a/lib/deprecated/runtime-core/doc/old-api/module.rs b/lib/deprecated/runtime-core/doc/old-api/module.rs new file mode 100644 index 000000000..e49c528cb --- /dev/null +++ b/lib/deprecated/runtime-core/doc/old-api/module.rs @@ -0,0 +1,10 @@ +struct Module {} + +impl Module { + 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>>; +}