pub trait AsImport {
    fn name(&self) -> &str;
    fn add_func(&mut self, name: impl AsRef<str>, func: Function);
    fn add_table(&mut self, name: impl AsRef<str>, table: Table);
    fn add_memory(&mut self, name: impl AsRef<str>, memory: Memory);
    fn add_global(&mut self, name: impl AsRef<str>, global: Global);
}
Expand description

The object to be registered via the the Executor::register_import_object function is required to implement this trait.

Required Methods§

Returns the name of the module instance.

Imports a host function instance.

Arguments
  • name - The name of the host function instance to import.

  • func - The host function instance to import.

Imports a table instance.

Arguments
  • name - The name of the host table instance to import.

  • table - The host table instance to import.

Imports a memory instance.

Arguments
  • name - The name of the host memory instance to import.

  • memory - The host memory instance to import.

Imports a global instance.

Arguments
  • name - The name of the host global instance to import.

  • global - The host global instance to import.

Implementors§