No way to identify an Event's variant.
In the previous versions, it was possible to retrieve the opcode from an Event with the MessageGroup trait. The latest beta version (0.30.0-beta.8) doesn't allow to do so.
Moreover, the fact that Events are single standing structs without a shared type/trait makes it lose in genericity compared to the last stable version.
Needing to work with opcodes directly is imo a strong hint that you might want to use the lower-level interface ObjectData from wayland-backend, maybe?
What is your need?
I'm just storing information given by the events (think those of WlOutput for instance) in an array/HashMap.
Right now, I have to manually declare a key associated to each variant in order to make the HashMap behave like a set, whereas, with the latest stable version, I could just use a fixed-size array (with size that of the MessageGroup's event), and use the event's numerical id as the key.
Well, that an uncommon way of handling events. But I suppose adding an fn opcode(&self) -> u16 method to the code generated by the scanner is not a big deal anyway.
Out of curiosity, how would you manage events ? Without further assumption on use, proxy type, etc, just as a source of information to be queried later.
Without further assumption on use, proxy type, etc, just as a source of information to be queried later.
Well, that is in itself, a pretty uncommon way to handle events. Most client interpret the event content as soon as it is received and store relevant information in specialized structs. From what you're saying your use-case does not fit "most clients", so that's kinda difficult to tell without knowing more about what you're trying to do.