回调函数(Callback)Choice

sealed interface CallbackChoice<out ContinueT, out BreakT>

A generic callback choice type for callbacks.

Type Parameters

ContinueT

The type of data passed forward when continuing execution.

BreakT

The type of data returned when breaking/short-circuiting execution.

Inheritors

类型

Link copied to clipboard
data class Break<out BreakT>(val value: BreakT) : CallbackChoice<Nothing, BreakT>

停止或中断程序的执行,并返回一个最终值或替代值。

Link copied to clipboard
data class Continue<out ContinueT>(val value: ContinueT) : CallbackChoice<ContinueT, Nothing>

继续执行流程,将原始数据或修改后的数据传递到下一阶段。