match<T> method
Implementation
T match<T>({
required T Function(SimulationConstantSpeed value) speed,
required T Function(SimulationAutoWithOverSpeed value) overSpeed,
}) {
return switch (this._index) {
0 => speed(this._value as SimulationConstantSpeed),
1 => overSpeed(this._value as SimulationAutoWithOverSpeed),
_ => throw NativeException("Unrecognized case index ${this._index}")
};
}