Result::or_else
pub fn or_else<F>(E -> Result<T, F> f) -> Result<T, F>
Source: compiler/src/prelude/core.hy This result if it is Ok, otherwise f(error).
Called on a Result value as value.or_else(…).
Parameters#
| Name | Type |
|---|---|
f | E -> Result<T, F> |
Returns#
Result<T, F>
See also#
ResultResult::is_ok: True when this isOk.Result::is_err: True when this isErr.Result::ok: TheOkvalue as anOption.Result::err: TheErrvalue as anOption.Result::unwrap_or: TheOkvalue, orfallbackonErr.Result::unwrap_or_else: TheOkvalue, orfapplied to the error.Result::map:Ok(f(value)), or the same error.