operator & method

Result<T, E> operator &(
  1. Result<T, E> other
)

Combines two already-evaluated results using the and operator (&).

Shorthand for calling and. Returns this result if it's an error, otherwise returns other. Because Dart evaluates operator operands before calling the operator, this does not prevent other from being created. Use andLazy when the fallback computation must be skipped.

Example:

final result = checkAuth(user) & validateData(data) & saveData(data);

Implementation

Result<T, E> operator &(Result<T, E> other) => and(other);