Error

data class Error(val exception: Exception) : Result<Nothing>

The operation failed with an exception describing the cause.

Parameters

exception

The error that caused the operation to fail.

Constructors

Link copied to clipboard
constructor(exception: Exception)

Properties

Link copied to clipboard
val <T> Result<T>.data: T?

Extracts the data from a Result.Success, or returns null for all other states.

Link copied to clipboard

Functions

Link copied to clipboard
fun <T, R> Result<T>.map(block: (T) -> Result<R>): Result<R>

Transforms a successful result using block, propagating Result.Loading, Result.Empty, and Result.Error unchanged.