Error Handling

Rust provides a variety of ways to deal with error conditions. At a high level, simplified:

ConstructTypically Used For
panicUnrecoverable errors.
Option typeWhen a value is optional, and the lack of an option may or may not be an error condition.
ResultThere is a problem, and it should be dealt with.

Learn more: https://doc.rust-lang.org/stable/rust-by-example/error.html