bind<T extends Object> abstract method
If this is a Success
, maps S
to Result, otherwise returns F
untouched.
See pipe for an asynchronous variant of this function.
Success(1).bind((v) => Failure(v.toString())); // Failure('1')
Failure(2).bind((v) => Failure(v.toString())); // Failure(2)
Implementation
@useResult Result<T, F> bind<T extends Object>(Result<T, F> Function(S success) function);