map<T extends Object> abstract method

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

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

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