pipe<T extends Object> method

  1. @override
  2. @useResult
Future<Result<T, F>> pipe<T extends Object>(
  1. Future<Result<T, F>> function(
    1. S success
    )
)
override

If this is a Success, asynchronously maps S to Result, otherwise returns F untouched.

See bind for a synchronous variant of this function.

Future<String> stringifyAsync(int value) async => Failure(v.toString());

Success(1).pipe(stringifyAsync); // Failure('1')

Failure(2).pipe(stringifyAsync); // Failure(2)

Implementation

@override
@useResult Future<Result<T, F>> pipe<T extends Object>(Future<Result<T, F>> Function(S success) function) async => Failure(failure);