Function try

Source
pub fn try<T, E>(value: Result<T, E>, error_message: &str) -> T
Expand description

Attempts to unwrap a Result. If it’s an Err, exit program with given error message.