Failed

data class Failed(val routingError: Routing.Error) : AdminResult<Nothing> (source)

Device reported a routing error.

Parameters

routingError

the wire Routing.Error enum value

Constructors

Link copied to clipboard
constructor(routingError: Routing.Error)

Properties

Link copied to clipboard

Returns true if this is AdminResult.Success.

Link copied to clipboard
val routingError: Routing.Error

Functions

Link copied to clipboard
inline fun <T, R> AdminResult<T>.fold(onSuccess: (T) -> R, onFailure: (AdminResult<T>) -> R): R

Applies onSuccess or onFailure depending on the result.

Link copied to clipboard
fun <T> AdminResult<T>.getOrElse(default: T): T

Returns the Success value, or default if the result is not a success.

inline fun <T> AdminResult<T>.getOrElse(block: (AdminResult<T>) -> T): T

Returns the Success value, or the result of block if the result is not a success.

Link copied to clipboard

Returns the Success value, or null if the result is not a success.

Link copied to clipboard

Returns the Success value or throws AdminResultException describing the failure.

Link copied to clipboard
inline fun <T, R> AdminResult<T>.map(transform: (T) -> R): AdminResult<R>

Transforms the Success value with transform, propagating failures unchanged.

Link copied to clipboard
inline fun <T> AdminResult<T>.onFailure(action: (AdminResult<T>) -> Unit): AdminResult<T>

Performs action if this is not a Success. Returns the original result for chaining.

Link copied to clipboard
inline fun <T> AdminResult<T>.onSuccess(action: (T) -> Unit): AdminResult<T>

Performs action if this is a Success. Returns the original result for chaining.