A function applied to the value wrapped in result
if it is
an Err
, to generate the final value.
The result
to unwrap if it is an Ok
.
The value wrapped in result
if it is Ok
or the value
returned by orElseFn
applied to the value in Err
.
T The value wrapped in the Ok
.
E The value wrapped in the Err
.
Generated using TypeDoc
Safely get the value out of a
Result
by returning the wrapped value if it isOk
, or by applyingorElseFn
to the value in theErr
.This is useful when you need to generate a value (e.g. by using current values in the environment – whether preloaded or by local closure) instead of having a single default value available (as in
unwrapOr
).