Struct zng_app::crash_handler::CrashConfig
source · pub struct CrashConfig { /* private fields */ }
Expand description
Crash handler config.
Use crash_handler_config!
to set config.
Implementations§
source§impl CrashConfig
impl CrashConfig
sourcepub fn dialog(&mut self, handler: impl FnOnce(CrashArgs) + 'static)
pub fn dialog(&mut self, handler: impl FnOnce(CrashArgs) + 'static)
Set the crash dialog process handler.
The dialog handler
can run an app or show a native dialog, it must use the CrashArgs
process
terminating methods to respond, if it returns CrashArgs::exit
will run.
Note that the handler does not need to actually show any dialog, it can just save crash info and restart the app for example.
sourcepub fn default_dialog(&mut self, handler: impl FnOnce(CrashArgs) + 'static)
pub fn default_dialog(&mut self, handler: impl FnOnce(CrashArgs) + 'static)
Set the crash dialog-handler used if crash_dialog
is not set.
This is used by app libraries or themes to provide a default dialog.
sourcepub fn app_process(
&mut self,
cfg: impl for<'a, 'b> FnMut(&'a mut Command, &'b CrashArgs) -> &'a mut Command + 'static,
)
pub fn app_process( &mut self, cfg: impl for<'a, 'b> FnMut(&'a mut Command, &'b CrashArgs) -> &'a mut Command + 'static, )
Add a closure that is called just before the app-process is spawned.
sourcepub fn dialog_process(
&mut self,
cfg: impl for<'a, 'b> FnMut(&'a mut Command, &'b CrashArgs) -> &'a mut Command + 'static,
)
pub fn dialog_process( &mut self, cfg: impl for<'a, 'b> FnMut(&'a mut Command, &'b CrashArgs) -> &'a mut Command + 'static, )
Add a closure that is called just before the dialog-process is spawned.
sourcepub fn minidump_dir(&mut self, dir: impl Into<PathBuf>)
pub fn minidump_dir(&mut self, dir: impl Into<PathBuf>)
Change the minidump directory.
Is zng::env::cache("zng_minidump")
by default.
sourcepub fn no_minidump(&mut self)
pub fn no_minidump(&mut self)
Do not collect a minidump.
sourcepub fn no_crash_handler(&mut self)
pub fn no_crash_handler(&mut self)
Does not run with crash handler.
This is equivalent of running with NO_ZNG_CRASH_HANDLER
env var.
Auto Trait Implementations§
impl Freeze for CrashConfig
impl !RefUnwindSafe for CrashConfig
impl !Send for CrashConfig
impl !Sync for CrashConfig
impl Unpin for CrashConfig
impl !UnwindSafe for CrashConfig
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more