ApiResult

sealed class ApiResult<out T : Any>

Inheritors

Types

Link copied to clipboard
sealed class Error : ApiResult<Nothing>

Uh oh this request hit a snag.

Link copied to clipboard
data class Success<out T : Any>(val value: T) : ApiResult<T>

Success!

Functions

Link copied to clipboard
inline fun <T : Any> ApiResult<T>.getOrNull(): T?
Link copied to clipboard
inline fun <R : Any, T : Any> ApiResult<T>.map(transform: (value: T) -> R?): ApiResult<R>
Link copied to clipboard
inline fun <T : Any> ApiResult<T>.onError(block: (Throwable) -> Unit): ApiResult<T>
Link copied to clipboard
inline fun <T : Any> ApiResult<T>.onSuccess(block: (T) -> Unit): ApiResult<T>