Core API
This chapter briefly describes the API of the lowest layer of Marine. This layer is intended to provide the most basic API for module handling. The most functionality could be tested with a help of the Marine REPL.
Calling a module
rust
rust
Invokes a function of a module inside Marine by given function name with given arguments. For more info about IValue take a look to this chapter.
Loading a module
rust
rust
Loads a new module with the provided config inside Marine. All modules should have unique names. This config allows you to flexible adjusting of the behavior of the loaded module, it has the following structure:
rust
rust
Unloading a module
rust
rust
Unloads a module from Marine by name. Use it carefully. It could crash service after the call if the module that linked with another will be unloaded.
Getting a WASI state
rust
rust
Returns a WASI state of a module.
Getting a module interface
- interface
- MModuleInterface
rust
rust
rust
rust
These methods returns a public interface of a module, i.e. a set of all public functions and records.
Getting module memory stats
- module_memory_stats
- MemoryStats
rust
rust
rust
rust
Returns a statistics of memory usage for all loaded modules.