Result

class Result<T>

The outcome of an operation: either a success value or an NRError.

Register handlers with onSuccess and onFailure. Both return this result, so they can be chained.

Type Parameters

T

The type of the success value.

Types

Link copied to clipboard
object Companion

Factory methods for creating Result instances.

Functions

Link copied to clipboard
fun onFailure(action: (error: NRError) -> Unit): Result<T>

Runs action with the error if this result is a failure.

Link copied to clipboard
fun onSuccess(action: (value: T) -> Unit): Result<T>

Runs action with the success value if this result is a success.