NetworkEither

sealed class NetworkEither<out F, out S>

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
sealed class Failure<out F> : NetworkEither<F, Nothing>
Link copied to clipboard
data class Success<out S>(val data: S, val code: Int, val headers: Headers) : NetworkEither<Nothing, S>

Functions

Link copied to clipboard
inline fun <A> fold(failure: () -> A, success: (S) -> A): A
inline fun <A> fold(httpFailure: (NetworkEither.Failure.Http<F>) -> A, localFailure: () -> A, remoteFailure: () -> A, unknownFailure: (Throwable) -> A, success: (NetworkEither.Success<S>) -> A): A
Link copied to clipboard
@JvmName(name = "getCode1")
fun getCode(): Int
Link copied to clipboard
Link copied to clipboard
fun getSuccess(): S
Link copied to clipboard
Link copied to clipboard
@JvmName(name = "getThrowable1")
fun getThrowable(): Throwable
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun ifFailureLocal(block: () -> Unit)
Link copied to clipboard
fun ifFailureRemote(block: () -> Unit)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <L, R> toEither(crossinline httpFailure: (NetworkEither.Failure.Http<F>) -> L, localFailure: () -> L, remoteFailure: () -> L, crossinline unknownFailure: (Throwable) -> L, crossinline success: (NetworkEither.Success<S>) -> R): Either<L, R>