bindFailure<T extends Object> method
- @override
- @useResult
- Result<
S, T> function(- F failure
override
If this is a Failure
, maps F
to Result, otherwise returns S
untouched.
See pipeFailure for an asynchronous variant of this function.
Success(1).bindFailure((v) => Failure(v.toString())); // Success(1)
Failure(2).bindFailure((v) => Success(v.toString())); // Success('2')
Implementation
@override
@useResult Result<S, T> bindFailure<T extends Object>(Result<S, T> Function(F failure) function) => function(failure);