Struct crash_handler::CrashHandler
source · pub struct CrashHandler;Expand description
A Windows exception handler
Implementations§
source§impl CrashHandler
impl CrashHandler
sourcepub fn attach(on_crash: Box<dyn CrashEvent>) -> Result<Self, Error>
pub fn attach(on_crash: Box<dyn CrashEvent>) -> Result<Self, Error>
Attaches the crash handler.
The provided callback will be invoked if an exception is caught,
providing a crate::CrashContext with the details of the thread where
the exception was thrown.
sourcepub fn detach(self)
pub fn detach(self)
Detaches this handler, removing it from the handler stack.
This is done automatically when this CrashHandler is dropped.
sourcepub fn simulate_exception(
&self,
exception_code: Option<i32>
) -> CrashEventResult
pub fn simulate_exception( &self, exception_code: Option<i32> ) -> CrashEventResult
Creates an exception with the specified exception code that is passed through the user provided callback.