class

Wasmer::Exports

Inherits Reference / Object

Represents all the exports of an instance.

Exports can be of kind Function, Global, Table, or Memory. Exports is a special kind of map that allows easily unwrapping the types of instances.

Instance methods

[](name : String) : Extern

Retries and returns an Extern by its name. If the name does not refer to an existing export, it will raise an exception

Source
function(name : String)

Retrieves an exported function by its name and return it as a native Crystal Proc The difference with raw_function is that Function#native has been called on the exported function.

Note: If the name does not refer to an existing export, function raises exception. Note: If the export is not a function, function will return nil as its result

Source
global(name : String) : Global | Nil

Retrieves and return an exported Global by its name. If the name doesn't not refer to an existing export, it will raise an exception. if the export is not a global, it will return nil as its result

Source
memory(name : String) : Memory | Nil

Retrieves and return an exported Memory by its name. If the name doesn't not refer to an existing export, it will raise an exception. if the export is not a memory, it will return nil as its result

Source
raw_function(name : String) : Function | Nil

Retrieves and return an exported function by its name. If the name doesn't not refer to an existing export, it will raise an exception. if the export is not a function, it will return nil as its result

Source
table(name : String) : Table | Nil

Retrieves and return an exported Table by its name. If the name doesn't not refer to an existing export, it will raise an exception. if the export is not a table, it will return nil as its result

Source
wasi_start_func

Similar to function("_start"). It saves you the cost of knowing the name of the WASI start function.

Source