Trait rdcl_aoc_helpers::error::WithOrExit
source · pub trait WithOrExit<T> {
fn or_exit_with(self, exit_code: i32) -> T;
}
Expand description
Trait that adds the or_exit_with
method to a struct. To be used to create a way to retrieve a
value, or exit with a specified error code.
Required Methods
fn or_exit_with(self, exit_code: i32) -> T
Implementations on Foreign Types
sourceimpl<T, E: Debug> WithOrExit<T> for Result<T, E>
impl<T, E: Debug> WithOrExit<T> for Result<T, E>
sourcefn or_exit_with(self, exit_code: i32) -> T
fn or_exit_with(self, exit_code: i32) -> T
Unwraps the value from a Result, or terminates the process with the specified exit code.