pipeFailure<T extends Object> method
If this is a Failure
, asynchronously maps F
to Result, otherwise returns S
untouched.
See bindFailure for a synchronous variant of this function.
Future<String> stringifyAsync(int value) async => Success(v.toString());
Success(1).pipeFailure(stringifyAsync); // Success(1)
Failure(2).pipeFailure(stringifyAsync); // Success('2')
Implementation
@override
@useResult Future<Result<S, T>> pipeFailure<T extends Object>(Future<Result<S, T>> Function(F failure) function) async => Success(success);