class Wasmer::Exports
- Wasmer::Exports
- Reference
- Object
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.crInstance Method Summary
-
#[](name : String) : Extern
Retries and returns an
Extern
by its name. -
#function(name : String)
Retrieves an exported function by its name and return it as a native Crystal Proc The difference with
#raw_function
is thatFunction#native
has been called on the exported function. -
#global(name : String) : Global | Nil
Retrieves and return an exported Global by its name.
-
#memory(name : String) : Memory | Nil
Retrieves and return an exported Memory by its name.
-
#raw_function(name : String) : Function | Nil
Retrieves and return an exported function by its name.
-
#table(name : String) : Table | Nil
Retrieves and return an exported Table by its name.
-
#wasi_start_func
Similar to function("_start").
Instance Method Detail
Retries and returns an Extern
by its name.
If the name does not refer to an existing export, it will raise an exception
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
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
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
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
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
Similar to function("_start"). It saves you the cost of knowing the name of the WASI start function.