Companion

Companion object for Result class that contains its constructor functions success and failure.

Since Kotlin

1.3

Functions

Link copied to clipboard
@JvmName(name = "failure")
inline fun <T> failure(exception: Throwable): Result<T>

Returns an instance that encapsulates the given Throwable as failure.

Since Kotlin 1.3
Link copied to clipboard
@JvmName(name = "success")
inline fun <T> success(value: T): Result<T>

Returns an instance that encapsulates the given value as successful value.

Since Kotlin 1.3