Package-level declarations
Utilities for the Outcome type, allowing to embed typed error management directly into the API without using exceptions.
Types
Properties
Link copied to clipboard
Returns Failure.failure, or null
if this outcome is not a failure.
Link copied to clipboard
Returns Success.value, or null
if this outcome is not successful.
Functions
Link copied to clipboard
inline fun <Failure, InputValue, OutputValue> Outcome<Failure, InputValue>.map(transform: (InputValue) -> OutputValue): Outcome<Failure, OutputValue>
If this outcome is successful, replaces its value using transform.
Link copied to clipboard
inline fun <InputFailure, Value, OutputFailure> Outcome<InputFailure, Value>.mapFailure(transformFailure: (InputFailure) -> OutputFailure): Outcome<OutputFailure, Value>
If this outcome is failed, replaces its failure using transformFailure.
Link copied to clipboard