[−][src]Macro lucet_runtime_internals::lucet_hostcall_terminate
Terminate an instance from within a hostcall, returning an optional value as an error.
Use this instead of panic!
when you want the instance to terminate, but not the entire host
program. Like panic!
, you can pass a format string with arguments, a value that implements
Any
, or nothing to return a default message.
Upon termination, the call to Instance::run()
will return with an
Err(Error::RuntimeTerminated)
value containing the value you pass to this macro.
This macro safely unwinds the hostcall stack out to the entrypoint of the hostcall, so any resources that may have been acquired will be properly dropped.