These are chat archives for rust-lang/rust
Hi. In python I could use metaclasses to get a list of all classes inheriting a base class. Now, I know rust does not have classes, however I'm wondering what would be an idiomatic way to achieve the same effect?
Think about implementing the command pattern: you have different commands, and you want them all to get registered as classes into a generic factory, which can create any command based on an unique id.
impl traitmight work too
Defaultand otherwise implements the interface you want to expose.
Default(which you can derive).