struct PanicNotifier<'a> {
id: usize,
main_status: &'a Status<MainStatus>,
}Expand description
Object whose destructor notifies the main thread that a panic happened.
The way to use this is to create an instance before a section that may
panic, and to std::mem::forget() it at the end of the section. That way:
- If a panic happens, the
std::mem::forget()call will be skipped but the destructor will run due to RAII. - If no panic happens, the destructor won’t run because this object will be forgotten.
Fields§
§id: usizeThread index.
main_status: &'a Status<MainStatus>Status of the main thread.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for PanicNotifier<'a>
impl<'a> RefUnwindSafe for PanicNotifier<'a>
impl<'a> Send for PanicNotifier<'a>
impl<'a> Sync for PanicNotifier<'a>
impl<'a> Unpin for PanicNotifier<'a>
impl<'a> UnwindSafe for PanicNotifier<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more