class Wasmer::ImportType
- Wasmer::ImportType
- Reference
- Object
Overview
ImportType is a descriptor for an imported value into a WebAssembly module
Defined in:
wasmer/import.crConstructors
-
.new(namespace : String, name : String, type : WithExternType)
Instantiates a new
ImportType
with a module name (or namespace), a name and en extern type.
Instance Method Summary
-
#mod_name : String
Returns the
ImportType
's module name (or namespace)val_type = ValueType.new(Wasmer::I32) global_type = GlobalType.new(val_type, Wasmer::IMMUTABLE) import_type = ImportType.new("ns", "host_global", global_type) import_type.mod_name
-
#name : String
Returns the
ImportType
's nameval_type = ValueType.new(Wasmer::I32) global_type = GlobalType.new(val_type, Wasmer::IMMUTABLE) import_type = ImportType.new("ns", "host_global", global_type) import_type.name
-
#type : ExternType
Returns the
ImportType
's type as anExternType
val_type = ValueType.new(Wasmer::I32) global_type = GlobalType.new(val_type, Wasmer::IMMUTABLE) import_type = ImportType.new("ns", "host_global", global_type) import_type.type
Constructor Detail
Instantiates a new ImportType
with a module name (or namespace),
a name and en extern type.
Note: An extern is anything implementing WithExtern
: Function
, Global
, Memory
, Table
val_type = ValueType.new(Wasmer::I32)
global_type = GlobalType.new(val_type, Wasmer::IMMUTABLE)
import_type = ImportType.new("ns", "host_global", global_type)
Instance Method Detail
Returns the ImportType
's module name (or namespace)
val_type = ValueType.new(Wasmer::I32)
global_type = GlobalType.new(val_type, Wasmer::IMMUTABLE)
import_type = ImportType.new("ns", "host_global", global_type)
import_type.mod_name
Returns the ImportType
's name
val_type = ValueType.new(Wasmer::I32)
global_type = GlobalType.new(val_type, Wasmer::IMMUTABLE)
import_type = ImportType.new("ns", "host_global", global_type)
import_type.name
Returns the ImportType
's type as an ExternType
val_type = ValueType.new(Wasmer::I32)
global_type = GlobalType.new(val_type, Wasmer::IMMUTABLE)
import_type = ImportType.new("ns", "host_global", global_type)
import_type.type