successOf

inline fun <Ok : Any> successOf(block: () -> Ok): Success<Ok>

Builds a Success outcome with the value provided by the block.

Return

A Success instance containing the value returned by the block.

Parameters

Ok

The output type of the block, which must be a subtype of Any.

block

The block that provides the value for the success outcome.


inline fun <In, Out : Any> In.successOf(block: (In) -> Out): Success<Out>

Builds a Success outcome with the value provided by the block.

Receiver

Some input type, In, passed to block.

Return

A Success instance containing the value returned by the block.

Parameters

Out

The output type of the block, which must be a subtype of Any.

block

The block that provides the value for the success outcome.