Struct ethcore_io::PanicHandler
[−]
[src]
pub struct PanicHandler { /* fields omitted */ }
Structure that allows to catch panics and notify listeners
Methods
impl PanicHandler
[src]
fn new_in_arc() -> Arc<Self>
Creates new PanicHandler
wrapped in Arc
fn new() -> Self
Creates new PanicHandler
fn catch_panic<G, R>(&self, g: G) -> Result<R> where G: FnOnce() -> R + Send + 'static
Invoke closure and catch any possible panics. In case of panic notifies all listeners about it.
fn notify_all(&self, r: String)
Notifies all listeners in case there is a panic.
You should use catch_panic
instead of calling this method explicitly.
Trait Implementations
impl Default for PanicHandler
[src]
impl MayPanic for PanicHandler
[src]
fn on_panic<F>(&self, closure: F) where F: OnPanicListener
closure
will be invoked whenever panic in thread is caught