Result¶
No import is needed.
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
Result¶
Result<T, E> - the outcome of an operation that may fail.
Ok¶
Contains the successful result.
Err¶
Contains the error result.
is_ok¶
True when this is Ok.
is_err¶
True when this is Err.
unwrap_or¶
The success value when Ok, otherwise fallback.
unwrap¶
The success value, or panics if Err.
expect¶
The success value, or panics with msg if Err.
unwrap_or_else¶
The success value, or f(error) when Err.
unwrap_err¶
The error value, or panics if Ok.
ok¶
Some when Ok, otherwise None.
or_else¶
Maps Err through f, otherwise preserves Ok.
map¶
Maps the success value when Ok, otherwise preserves the error.
map_err¶
Maps the error when Err, otherwise preserves the success value.
and_then¶
Chains into another Result when Ok, otherwise preserves the error.