bindFailure<T extends Object> abstract method
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
@useResult Result<S, T> bindFailure<T extends Object>(Result<S, T> Function(F failure) function);