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.

Returns the stack of this runtime.

Returns the stack of this runtime.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.