Result::unwrap_or
pub fn unwrap_or(T fallback) -> T
Source: compiler/src/prelude/core.hy The Ok value, or fallback on Err.
Called on a Result value as value.unwrap_or(…).
Parameters#
| Name | Type |
|---|---|
fallback | T |
Returns#
T
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_else: TheOkvalue, orfapplied to the error.Result::map:Ok(f(value)), or the same error.Result::map_err: The same value, orErr(f(error)).