Struct crash_handler::CrashHandler
source · [−]pub struct CrashHandler;Expand description
A Linux/Android signal handler
Implementations
sourceimpl 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 signal handler.
The provided callback will be invoked if a signal is caught, providing a
crate::CrashContext with the details of the thread where the
signal was raised.
The callback runs in a compromised context, so it is highly recommended to not perform actions that may fail due to corrupted state that caused or is a symptom of the original signal. This includes doing heap allocations from the same allocator as the crashing code.
sourcepub fn detach(self)
pub fn detach(self)
Detaches the handler.
This is done automatically when this CrashHandler is dropped.
sourcepub fn simulate_signal(&self, signal: Signal) -> CrashEventResult
pub fn simulate_signal(&self, signal: Signal) -> CrashEventResult
Sends the specified user signal.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for CrashHandler
impl Send for CrashHandler
impl Sync for CrashHandler
impl Unpin for CrashHandler
impl UnwindSafe for CrashHandler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more