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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CrashHandler
impl RefUnwindSafe for CrashHandler
impl Send for CrashHandler
impl Sync for CrashHandler
impl Unpin for CrashHandler
impl UnwindSafe for CrashHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more