mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-10 22:58:18 +00:00
doc(deprecated) Start documenting the diff between the old and the new API.
This commit is contained in:
18
lib/deprecated/runtime-core/doc/new-api/instance.rs
Normal file
18
lib/deprecated/runtime-core/doc/new-api/instance.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
struct Instance {
|
||||
module: Arc<ModuleInner>,
|
||||
exports: Exports,
|
||||
}
|
||||
|
||||
impl Instance {
|
||||
fn load<T: Loader>(&self, loader: T) -> Result<T::Instnace, T::Error>;
|
||||
fn fun<Args, Rets>(&self, name: &str) -> ResolveResult<Args, Rets, Wasm>;
|
||||
fn resolve_func(&self, name: &str) -> ResolveError<usize>;
|
||||
fn dyn_func(&self, name: &str) -> ResolveResult<DynFunc>;
|
||||
fn call(&self, name: &str, params: &[Value]) -> CallResult<Vec<Value>>;
|
||||
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);
|
||||
}
|
||||
10
lib/deprecated/runtime-core/doc/new-api/module.rs
Normal file
10
lib/deprecated/runtime-core/doc/new-api/module.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
struct Module {}
|
||||
|
||||
impl Module {
|
||||
fn instantiate(&self, import_object: &ImportObject) -> Result<Instance>;
|
||||
fn cache(&self) -> Result<Artifact, CacheError>;
|
||||
fn info(&self) -> &ModuleInfo;
|
||||
fn imports(&self) -> Vec<ImportDescriptor>;
|
||||
fn exports(&self) -> Vec<ExportDescriptor>;
|
||||
fn custom_sections(&self, key: impl AsRef<str>) -> Option<&[Vec<u8>]>
|
||||
}
|
||||
12
lib/deprecated/runtime-core/doc/old-api/instance.rs
Normal file
12
lib/deprecated/runtime-core/doc/old-api/instance.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
struct Instance {
|
||||
exports: Exports,
|
||||
}
|
||||
|
||||
impl Instance {
|
||||
fn load<T>(&self, _loader: T) -> Result<Self, ()>;
|
||||
fn resolve_func(&self, name: &str) -> Result<usize, ()>;
|
||||
fn call(&self, name: &str, params: &[Value]) -> Result<Vec<Value>, Box<dyn Error>>;
|
||||
fn context(&self) -> Ref<Ctx>;
|
||||
fn context_mut(&mut self) -> RefMut<Ctx>;
|
||||
fn module(&self) -> Module;
|
||||
}
|
||||
10
lib/deprecated/runtime-core/doc/old-api/module.rs
Normal file
10
lib/deprecated/runtime-core/doc/old-api/module.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
struct Module {}
|
||||
|
||||
impl Module {
|
||||
fn instantiate(&self, import_object: &ImportObject) -> Result<Instance, InstantiationError>;
|
||||
fn cache(&self) -> Result<Artifact, Infallible>;
|
||||
fn info(&self) -> &ModuleInfo;
|
||||
fn imports(&self) -> Vec<ImportDescriptor>;
|
||||
fn exports(&self) -> Vec<ExportDescriptor>;
|
||||
fn custom_sections(&self, name: impl Asref<str>) -> Option<Vec<Vec<u8>>>;
|
||||
}
|
||||
Reference in New Issue
Block a user