interrupt_execution
. This host function will immediately stop executing the WebAssembly module.Cargo.toml
to add the Wasmer dependencies as shown below:env
namespace, using the ImportObject
.early_exit
function once we call its run
function (which is an exported function). Let's get the function, call it and see how we can handle the error:run
function so what we do here is look at the result and:ExitCode
error.cargo run
command. The output should look like this:go run main.go
command. The output should look like this:python imports_function_early_exit.py
command.php imports-function-early-exit.php
command.ruby imports_function_early_exit.rb
command.