Result
Result module: operations on Result(a, e) = Ok(a) Err(e)
Result is the primary error-handling mechanism. Use it for any operation that can reasonably fail. Panics are reserved for programmer errors (invariant violations).
Functions
Returns true if the result is Ok.
Returns true if the result is Err.
Extracts the Ok value, panicking with the given message if Err. Use when you are certain the result is Ok.
Extracts the Ok value, panicking if Err.
Extracts the Err value, panicking if Ok.
Returns the Ok value, or default if Err.
Applies f to the Ok value, leaving Err unchanged.
Applies f to the Err value, leaving Ok unchanged.
Applies f (which returns a Result) to the Ok value, flattening the result.
Returns f(err) if Err, or the original Ok value.
Collects a list of Results into a Result of a list. Returns the first Err encountered, or Ok with all values if all are Ok.
Converts Result(a, e) to Option(a), discarding the error.