result
if it is an Ok
, otherwise defaultResult
.
T The type wrapped in the Ok
case of result
.
E The type wrapped in the Err
case of result
.
F The type wrapped in the Err
case of defaultResult
.
Generated using TypeDoc
Provide a fallback for a given
Result
. Behaves like a logicalor
: if theresult
value is anOk
, returns thatresult
; otherwise, returns thedefaultResult
value.This is useful when you want to make sure that something which takes a
Result
always ends up getting anOk
variant, by supplying a default value for the case that you currently have anErr
.