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