Remove remain dependancy
The remain dependency is incredibly frustrating to work with as it produces a compile error and requires you to manually sort your enum variants alphabetically. This is exacerbated by the very long compile times which are wasted when you realise the enum is not in order for the third time in a row.
It is not clear that the code is easier to read if the enums are in alphabetical order. Even if it were, then the solution would be to add an option to rust fmt or another linter.
Therefore the remain dependency and any uses of it can be removed.
I'm open to that if it's a pain point for you. The original idea was to standardize the ordering so the enum definition and message handler match arms would be in a predictable location relative to one another, which had gotten to be a bit of a problem. I really wish rustfmt had some way to keep enums and match statements alphabetized, but alas rustfmt seems to be borderline abandoned which is sad.
I did also have some ideas in mind to use macro metaprogramming to basically hide away the boilerplate of the separate enum variant definitions (in *_message.rs) and the message handler match arms (in *_message_handler.rs) by basically just writing the code for each handler in a top-level function within *_message_handler.rs and letting the macro copy out the code and stick it in the match arms as well as also inserting a matching variant in the message enum definition. I'm no macro expert but I wonder if that's feasible.
It isn't really possible to generate an enum with variants containing identifiers from several different macro calls (as enums have to be declared with all the variants). You could have a macro on the MessageHandler impl that looks for a match statement in a process_message function and then creates an enum from that - although you would need to declare the types of things.
Hi, I'd like to work on this :)