operator & method

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

Combines two results using the and operator (&).

Shorthand for calling and. Returns this result if it's an error, otherwise returns other. Use this for sequential operations where all must succeed. If this fails, subsequent operations are skipped.

Example:

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

Implementation

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