Skip to main content

catch_panic

Function catch_panic 

Source
pub fn catch_panic<R>(f: impl FnOnce() -> R) -> Option<R>
Expand description

A function to catch panics.

Used in duat-core in order to prevent sudden panics from just crashing the program, which would be bad for the end user I think.

You shouldn’t use this function unless you are doing a trait based API, where the implementation of traits by users might cause panics.