pub unsafe fn set_modification_panic_fn(panic_fn: fn())Expand description
Sets an alternative function to be called by the Drop implementation of TempInstMut
when it encounters an illegal modification.
ยงSafety
-
Changing the panic function is only allowed when no other thread is able to interact with this crate.
-
The panic function must not return unless
std::thread::panickingreturnstrue. -
If the panic function causes an unwinding panic, the caller of
set_modification_panic_fnassumes the responsibility that no instance or reference ofTempInstMutis used across (i.e. captured in)std::panic::catch_unwind.