Companion

object Companion

Functions

Link copied to clipboard
fun <Value, Result> nonSuspendOf(supply: () -> Result, accumulate: (current: Result, value: Value) -> Unit, characteristics: Set<Characteristics> = setOf()): NonSuspendCollector<Value, Result>

Constructs a new Collector from its components, where the accumulated value is directly its result

fun <InternalAccumulator, Value, Result> nonSuspendOf(supply: () -> InternalAccumulator, accumulate: (current: InternalAccumulator, value: Value) -> Unit, finish: (current: InternalAccumulator) -> Result, characteristics: Set<Characteristics> = setOf()): NonSuspendCollector<Value, Result>

Constructs a new Collector from its components

Link copied to clipboard
fun <Value, Result> of(supply: suspend () -> Result, accumulate: suspend (current: Result, value: Value) -> Unit, characteristics: Set<Characteristics> = setOf()): Collector<Value, Result>

Constructs a new Collector from its components, where the accumulated value is directly its result

fun <InternalAccumulator, Value, Result> of(supply: suspend () -> InternalAccumulator, accumulate: suspend (current: InternalAccumulator, value: Value) -> Unit, finish: suspend (current: InternalAccumulator) -> Result, characteristics: Set<Characteristics> = setOf()): Collector<Value, Result>

Constructs a new Collector from its components