ResultExtensions<T> extension

Utility extensions on the Result sealed hierarchy to streamline functional recovery paths and fluid asynchronous fallback operations.

on

Methods

getOrElseAsync(FutureOr<T> onFallback(Failure failure)) Future<T>

Available on Result<T>, provided by the ResultExtensions extension

Extracts the encapsulated success value directly from Success, or invokes an asynchronous fallback strategy when a Failure is encountered.
recover(Result<T> onFailure(Failure failure)) Result<T>

Available on Result<T>, provided by the ResultExtensions extension

Recovers from an operational failure by mapping the non-generic Failure instance into a new alternative Result.