Package-level declarations

The ProgressiveOutcome, which combines Outcome with Progress.

Types

Link copied to clipboard
sealed class ProgressiveOutcome<out Failure, out Value>

A Outcome with integrated Progress management.

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

The progression of this unsuccessful value.

Link copied to clipboard
Link copied to clipboard

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

Functions

Link copied to clipboard

Converts this progressive outcome into a regular outcome.

Link copied to clipboard

Replaces incomplete outcomes by the previous completed outcome, with the updated progress information.

Link copied to clipboard
Link copied to clipboard
operator fun ProgressiveOutcome<*, *>.component2(): Progress

Syntax sugar for ProgressiveOutcome.progress.

Link copied to clipboard

Replaces the progress information from this progressive outcome.

Link copied to clipboard

Convenience function to instantiate a ProgressiveOutcome.Failure.

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

Executes block if this outcome is a failure.

Link copied to clipboard
inline fun ProgressiveOutcome<*, *>.onIncomplete(block: () -> Unit)

Executes block if this outcome is incomplete.

Link copied to clipboard
inline fun ProgressiveOutcome<*, *>.onLoading(block: (Progress.Loading) -> Unit)

Executes block if this outcome is loading (its ProgressiveOutcome.progress is Progress.Loading).

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

Executes block if this outcome is successful.

Link copied to clipboard

Convenience function to instantiate a ProgressiveOutcome.Success.

Link copied to clipboard
Link copied to clipboard

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