map<T extends Object> abstract method
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);