I tried to write some generic code, which is similar to inheritance, but more efficient, and now have an idea how to simulate inheritance in current rust (preferably with using specialization). I wrote a text about that here and some example code here.
This approach still has some problems, but it may be pretty powerful, when doing it correctly. I’m not sure, if language updates would be needed in order to make this pattern work good. I’m interested, if someone has better ways to achieve such a design. If done correctly, this really could help to simplify something, I’m working on, but I also don’t know yet, if just defining the structs, I need in a special case, would be more usable, even if this would result in code duplication.