okOr<E> abstract method
Transforms an Option into a Result, mapping Some to an Ok of the contained value and
None to Err of error
.
Examples
// prints "Ok(2)"
print(const Some(2).okOr('none'));
// prints "Err(none)"
print(const None<int>().okOr('none'));
Implementation
@useResult
Result<T, E> okOr<E>(E error);