Response

data class Response<out T>(val attempts: Int, val response: T) : Outcome<T>

An outcome that includes a normal (i.e., non-exceptional) response.

Parameters

T

The type of result.

attempts

The number of attempts executed in order to reach the outcome. Starts at 1.

response

The response to an operation.

Constructors

Link copied to clipboard
constructor(attempts: Int, response: T)

Properties

Link copied to clipboard
open override val attempts: Int
Link copied to clipboard
val response: T

Inherited functions

Link copied to clipboard
fun <T> Outcome<T>.getOrThrow(): T

Gets the non-exceptional response in this outcome if it exists. Otherwise, throws the exception in this outcome.

Link copied to clipboard
fun <T> Outcome<T>.toResult(): <Error class: unknown class><T>

Convert an outcome to a Result