transf<R extends Object> method
Transforms the Outcome's generic type from T
to R
.
Uses the transformer function noFutures
if provided, otherwise
attempts a direct cast.
Implementation
@override
Async<R> transf<R extends Object>([@noFutures R Function(T e)? noFutures]) {
return Async(() async {
final okOrErr = (await value).transf<R>(noFutures);
switch (okOrErr) {
case Ok(value: final okValue):
return okValue;
case Err():
throw okOrErr;
}
});
}