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§
Required Methods§
Sourcefn handler_for(instruction: I, abrupt: &Self::Abrupt) -> Option<Self::HandlerId>
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".