unwrapOr abstract method
- @useResult
- T defaultValue
Returns the contained value, if any, or defaultValue
otherwise.
Examples
// prints "2"
print(const Ok<int, String>(2).unwrapOr(3));
// prints "3"
print(const Err<int, String>('error').unwrapOr(3));
Implementation
@useResult
T unwrapOr(T defaultValue);