bindFailure<T extends Object> method

  1. @override
  2. @useResult
Result<S, T> bindFailure<T extends Object>(
  1. Result<S, T> function(
    1. 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);