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

Converts this object into an Any to dynamically check its type.

Returns whether the given program counter lies within wasm code, indicating whether we should handle a trap or not.

Uses call to call a custom signal handler, if one is specified.

Returns true if call returns true, otherwise returns false.

Returns the maximum size, in bytes, the wasm native stack is allowed to grow to.

Implementors