Success

data class Success<Value>(val value: Value) : Outcome<Nothing, Value> (source)

The latest known result of the operation was a success, available as value.

Constructors

Link copied to clipboard
constructor(value: Value)

Properties

Link copied to clipboard
Link copied to clipboard

Returns Failure.failure, or null if this outcome is not a failure.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns Success.value, or null if this outcome is not successful.

Functions

Link copied to clipboard

If this outcome is successful, replaces its value using transform.

Link copied to clipboard

If this outcome is failed, replaces its failure using transformFailure.

Link copied to clipboard
inline fun <Failure> Outcome<Failure, *>.onFailure(block: (Failure) -> Unit)

Executes block if this outcome is a failure.

Link copied to clipboard
inline fun <Value> Outcome<*, Value>.onSuccess(block: (Value) -> Unit)

Executes block if this outcome is successful.

Link copied to clipboard

Converts an Outcome into a typed Either.

Link copied to clipboard

Adds progress information to this outcome to make it a ProgressiveOutcome.