The fields in the enum variants have consistent types, so this is derivable in the general case. Seems quite straightforward but maybe I'm searching for the wrong things, I can't find a macro that does this!
I don't think there is, but you should check out enum_dispatch. I'm not sure about your use case, but it feel like that's what you're really going for.
Also, you can apply two different transformations to the code in order to achieve similar results:
Turn the Event enum into a EventKind enum that only stores the type of event, and then add that to EventStruct.
Remove common fields from Event enum variants, add them to the struct (EventStruct) and store the Event enum in the struct to reduce duplication.
I personally favor the second approach because the first causes the final struct to be very large and mostly empty. When you use the struct, you'll have to check the event type before using the fields anyway, and it's faster to check for the enum discriminant (i.e. event kind) once in a destructuringmatch or if let, than to check whether multiple Options are Some.
You can add impl for the enum with fns to access individual fields that are common to different events and return Options: