class Wasmer::ImportType

Overview

ImportType is a descriptor for an imported value into a WebAssembly module

Defined in:

wasmer/import.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(namespace : String, name : String, type : WithExternType) #

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)

[View source]

Instance Method Detail

def 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

[View source]
def name : String #

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

[View source]
def type : ExternType #

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

[View source]