pub struct AbortOnUnwind(pub &'static str);Expand description
Aborts the process when dropped, logging the message first.
Guards code that must not unwind, for example while state that the kernel
or other threads still use is taken out of its owner. Declare the guard
after such state, so it is dropped first while unwinding, and call
disarm() once the guarded code completed.
Bind the guard to a named variable, let _ = AbortOnUnwind(..) drops it,
and aborts, immediately.
use ntex_rt::AbortOnUnwind;
let guard = AbortOnUnwind("operation panicked");
// code that must not unwind
guard.disarm();Tuple Fields§
§0: &'static strImplementations§
Source§impl AbortOnUnwind
impl AbortOnUnwind
Trait Implementations§
Source§impl Debug for AbortOnUnwind
impl Debug for AbortOnUnwind
Source§impl Drop for AbortOnUnwind
impl Drop for AbortOnUnwind
Auto Trait Implementations§
impl Freeze for AbortOnUnwind
impl RefUnwindSafe for AbortOnUnwind
impl Send for AbortOnUnwind
impl Sync for AbortOnUnwind
impl Unpin for AbortOnUnwind
impl UnsafeUnpin for AbortOnUnwind
impl UnwindSafe for AbortOnUnwind
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