to Outcome
fun <Ok, Error> Ok.toOutcome(predicate: Ok.() -> Boolean, faulter: Ok.() -> Error): Outcome<Ok, Error>
Wraps this value as an Outcome based on a predicate.
Parameters
Ok
The type of the value to wrap.
Error
The error type produced by faulter.
predicate
Determines whether the value represents success.
Smart-wraps any T as an Outcome.
null→ Failure wrapping a NullPointerException.Throwable, ThrowableWrapper → Failure wrapping the throwable directly.
Anything else → Success.
Use asSuccess or asFailure for direct wrapping without type inference.
Parameters
T
The type of the value to wrap.