Skip to main content

HandlerPolicy

Trait HandlerPolicy 

Source
pub trait HandlerPolicy<I> {
    type HandlerId: Copy + Eq + Ord;
    type Abrupt;

    // Required method
    fn handler_for(
        instruction: I,
        abrupt: &Self::Abrupt,
    ) -> Option<Self::HandlerId>;
}
Expand description

Selects protected regions and consumer-defined abrupt outcomes.

For example, a WebAssembly trap policy or a BEAM exit policy can supply it.

Required Associated Types§

Source

type HandlerId: Copy + Eq + Ord

Consumer-defined handler identity.

Source

type Abrupt

Consumer-defined abrupt outcome.

Required Methods§

Source

fn handler_for(instruction: I, abrupt: &Self::Abrupt) -> Option<Self::HandlerId>

Finds the handler, if any, for an instruction and abrupt outcome.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§