Skip to main content

ExitGracefully

Trait ExitGracefully 

Source
pub trait ExitGracefully<T> {
    // Required method
    fn ok_or_exit_with_errno(self, additional_info: Option<&str>) -> T;
}
Expand description

A trait which allows a more graceful program exit instead of the standard panic. Provides a custom exit code.

Required Methods§

Source

fn ok_or_exit_with_errno(self, additional_info: Option<&str>) -> T

Provide the inner value of a Result or exit gracefully with a message and custom errno.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§