mapFailure<T extends Object> abstract method
If this is a Failure
, maps F
to T
, otherwise returns S
untouched.
Success(1).mapFailure((v) => v.toString()); // Success(1)
Failure(2).mapFailure((v) => v.toString()); // Failure('2')
Implementation
@useResult Result<S, T> mapFailure<T extends Object>(T Function(F failure) function);