Content-Length: 8320 | pFad | https://doc.rust-lang.org/std/iter/../option/../../std/error/../../std/panic/fn.take_hook.html

take_hook in std::panic - Rust

take_hook

Function take_hook 

1.10.0 · Source
pub fn take_hook() -> Box<dyn Fn(&PanicHookInfo<'_>) + Sync + Send + 'static>
Expand description

Unregisters the current panic hook and returns it, registering the default hook in its place.

See also the function set_hook.

If the default hook is registered it will be returned, but remain registered.

§Panics

Panics if called from a panicking thread.

§Examples

The following will print “Normal panic”:

use std::panic;

panic::set_hook(Box::new(|_| {
    println!("Custom panic hook");
}));

let _ = panic::take_hook();

panic!("Normal panic");








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://doc.rust-lang.org/std/iter/../option/../../std/error/../../std/panic/fn.take_hook.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy