[−][src]Struct sp_panic_handler::AbortGuard
RAII guard for whether panics in the current thread should unwind or abort.
Sets a thread-local abort flag on construction and reverts to the previous setting when dropped.
Does not implement Send
on purpose.
Note: Because we restore the previous value when dropped, you are encouraged to leave the
AbortGuard
on the stack and let it destroy itself naturally.
Implementations
impl AbortGuard
[src]
pub fn force_unwind() -> AbortGuard
[src]
Create a new guard. While the guard is alive, panics that happen in the current thread will unwind the stack (unless another guard is created afterwards).
pub fn force_abort() -> AbortGuard
[src]
Create a new guard. While the guard is alive, panics that happen in the current thread will abort the process (unless another guard is created afterwards).
pub fn never_abort() -> AbortGuard
[src]
Create a new guard. While the guard is alive, panics that happen in the current thread will
never abort the process (even if AbortGuard::force_abort()
guard will be created afterwards).
Trait Implementations
impl Drop for AbortGuard
[src]
Auto Trait Implementations
impl !RefUnwindSafe for AbortGuard
[src]
impl !Send for AbortGuard
[src]
impl !Sync for AbortGuard
[src]
impl Unpin for AbortGuard
[src]
impl UnwindSafe for AbortGuard
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,