mapFailure<T extends Object> 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
@override
@useResult Result<S, T> mapFailure<T extends Object>(T Function(F failure) function) => Failure(function(failure));