foldResult

inline fun <In, Out> KotlinResultFlow<In>.foldResult(crossinline success: suspend (In) -> Out, crossinline failure: suspend (Throwable) -> Out): Flow<Out>

Maps each element of the flow to Out by folding over its success or failure state. Equivalent to calling Result.fold on each element.

Parameters

In

The success value type of each result in the source flow.

Out

The output type produced by success and failure.