Result::map
pub fn map<U>(T -> U f) -> Result<U, E>
Source: compiler/src/prelude/core.hy Ok(f(value)), or the same error.
Called on a Result value as value.map(…).
Parameters#
| Name | Type |
|---|---|
f | T -> U |
Returns#
Result<U, E>
See also#
Result: The outcome of an operation that can fail:Ok(value)orErr(error).Result::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_err: The same value, orErr(f(error)).