Outcome
Represents either a Success or Failure state.
Unlike KotlinResult, Outcome carries the Error type explicitly, so error information is never erased. Moreover, Error has no type restrictions.
Use outcomeOf to build an Outcome with structured error-raising via RaiseScope.
Parameters
The type of the successful value.
The type of the error value.
See also
Inheritors
Properties
Property alias for flattenNestedFailure.
Property alias for flattenNestedBoth.
Property alias for flattenNestedSuccess.
Converts an Outcome to a KotlinResult.
Functions
Transforms the Success value of this Outcome, wrapping the result with outcome error-catching semantics.
Transforms the Success value of this Outcome, wrapping the result with outcomeOf error-catching semantics.
fun <OuterError, Ok : OuterError, InnerError> Outcome<Ok, InnerError>.errorOrRaise(): InnerError
Returns the Failure error, or short-circuits the surrounding RaiseScope with the Success value.
fun <OuterError, Ok, InnerError : OuterError> Outcome<Ok, InnerError>.getOrRaise(): Ok
Returns the Success value, or short-circuits the surrounding RaiseScope with the Failure error.