match<R> method
R
match<R>({})
Performs state matching similarly to fold, but explicitly passes the underlying granular Success context object rather than just its unwrapped value.
Implementation
R match<R>({
required R Function(Success<T> success) onSuccess,
required R Function(Failure failure) onFailure,
}) =>
switch (this) {
_SuccessResult<T>(success: final success) => onSuccess(success),
_FailureResult<T>(failure: final failure) => onFailure(failure),
};