toFault

inline fun <T> T.toFault(isFailure: T.() -> Boolean): Fault<T>

Wraps this value as a Fault based on isFailure.

Parameters

T

The type of the value to wrap.

isFailure

Determines whether the value represents a failure.


Smart-wraps any T as a Fault.

Parameters

T

The type of the value to wrap.