drop-panic 0.1.0

The callback that will be called if the current thread panics
Documentation
  • Coverage
  • 20%
    1 out of 5 items documented0 out of 3 items with examples
  • Size
  • Source code size: 2.57 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.32 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • bells307/drop-panic
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • bells307

drop-panic

The callback that will be called if the current thread panics.

Example

let panicked = Arc::new(AtomicBool::new(false));

let jh = thread::spawn({
    let panicked = Arc::clone(&panicked);
    move || {
        drop_panic! {
            panicked.store(true, Ordering::Release);
        };

        panic!("boom");
    }
});

assert!(jh.join().is_err());
assert!(panicked.load(Ordering::Acquire));