bind<T extends Object> abstract method

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

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);