map<T extends Object> method

  1. @override
  2. @useResult
Result<T, F> map<T extends Object>(
  1. T function(
    1. S success
    )
)
override

If this is a Success, maps S to T, otherwise returns F untouched.

Success(1).map((v) => v.toString()); // Success('1')

Failure(2).map((v) => v.toString()); // Failure(2)

Implementation

@override
@useResult Result<T, F> map<T extends Object>(T Function(S success) function) => Success(function(success));