mapOk method
Absorbs any throw from the callback into an Err. Widened from Ok<T>
to Result<T> to make room for the absorbed error.
Implementation
@override
@pragma('vm:prefer-inline')
Result<T> mapOk(@noFutures Ok<T> Function(Ok<T> ok) noFutures) {
try {
return noFutures(this);
} on Err catch (err) {
return err.transfErr<T>();
} catch (error, stackTrace) {
return Err<T>(error, stackTrace: stackTrace);
}
}