Trait wasmtime_runtime::TrapInfo [−][src]
pub unsafe trait TrapInfo {
fn as_any(&self) -> &dyn Any;
fn custom_signal_handler(
&self,
call: &dyn Fn(&SignalHandler<'_>) -> bool
) -> bool;
fn out_of_gas(&self);
fn interrupts(&self) -> &VMInterrupts;
}Expand description
A package of functionality needed by catch_traps to figure out what to do
when handling a trap.
Note that this is an unsafe trait at least because it’s being run in the
context of a synchronous signal handler, so it needs to be careful to not
access too much state in answering these queries.
Required methods
fn as_any(&self) -> &dyn Any[src]
fn as_any(&self) -> &dyn Any[src]Converts this object into an Any to dynamically check its type.
fn custom_signal_handler(
&self,
call: &dyn Fn(&SignalHandler<'_>) -> bool
) -> bool[src]
fn custom_signal_handler(
&self,
call: &dyn Fn(&SignalHandler<'_>) -> bool
) -> bool[src]Uses call to call a custom signal handler, if one is specified.
Returns true if call returns true, otherwise returns false.
fn out_of_gas(&self)[src]
fn out_of_gas(&self)[src]Callback invoked whenever WebAssembly has entirely consumed the fuel that it was allotted.
This function may return, and it may also raise_lib_trap.
fn interrupts(&self) -> &VMInterrupts[src]
fn interrupts(&self) -> &VMInterrupts[src]Returns the VM interrupts to use for interrupting Wasm code.