bind<T extends Object> method

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

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

@override
@useResult Result<T, F> bind<T extends Object>(Result<T, F> Function(S success) function) => Failure(failure);