class Wasmer::Exports

Overview

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.

Defined in:

wasmer/exports.cr

Instance Method Summary

Instance Method Detail

def [](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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def wasi_start_func #

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


[View source]