Struct wasm3::Runtime [−][src]
pub struct Runtime { /* fields omitted */ }
Expand description
A runtime context for wasm3 modules.
Implementations
Creates a new runtime with the given stack size in slots.
Errors
This function will error on memory allocation failure.
Parses and loads a module from bytes.
Loads a parsed module returning the module if unsuccessful.
Errors
This function will error if the module’s environment differs from the one this runtime uses.
Looks up a function by the given name in the loaded modules of this runtime.
See Module::find_function
for possible error cases.
Searches for a module with the given name in the runtime’s loaded modules.
Using this over searching through Runtime::modules
is a bit more efficient as it
works on the underlying CStrings directly and doesn’t require an upfront length calculation.
Returns an iterator over the runtime’s loaded modules.
Resizes the number of allocatable pages to num_pages.
Errors
This function will error out if it failed to resize memory allocation.
Returns the raw memory of this runtime.
Safety
The returned pointer may get invalidated when wasm function objects are called due to reallocations.
Returns the raw memory of this runtime.
Safety
The returned pointer may get invalidated when wasm function objects are called due to reallocations.