Success

data class Success<out T>(val data: T) : Result<T>

The operation completed successfully with data.

Parameters

data

The value produced by the operation.

Constructors

Link copied to clipboard
constructor(data: T)

Properties

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

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

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.