Trait wasmtime_runtime::TrapInfo
source · [−]pub unsafe trait TrapInfo {
fn as_any(&self) -> &dyn Any;
fn is_wasm_code(&self, pc: usize) -> bool;
fn custom_signal_handler(
&self,
call: &dyn Fn(&SignalHandler<'_>) -> bool
) -> bool;
fn max_wasm_stack(&self) -> usize;
}
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 is_wasm_code(&self, pc: usize) -> bool
fn is_wasm_code(&self, pc: usize) -> bool
Returns whether the given program counter lies within wasm code, indicating whether we should handle a trap or not.
fn custom_signal_handler(
&self,
call: &dyn Fn(&SignalHandler<'_>) -> bool
) -> bool
fn custom_signal_handler(
&self,
call: &dyn Fn(&SignalHandler<'_>) -> bool
) -> bool
Uses call
to call a custom signal handler, if one is specified.
Returns true
if call
returns true, otherwise returns false
.
fn max_wasm_stack(&self) -> usize
fn max_wasm_stack(&self) -> usize
Returns the maximum size, in bytes, the wasm native stack is allowed to grow to.