Inheritance structs


#1

As a new Rust programmer I started writing some small games, I quickly found out that it was very frustrating to not being able to inheritance structs (easily).

Is it planned to make it possible to inheritance structs?

See https://stackoverflow.com/questions/23623957/how-to-typecast-and-inherit-rust-structs


#2

There are currently mainly two competing proposals for adding inheritance to Rust:

RFC PR 142: Efficient single inheritance. RFC PR 223: Trait based inheritance.

Personally I lean towards the latter as it is more orthogonal and flexible, but both have their pros and cons.


#3

Also please note this is not a support forum.

It is possible that your use case doesn’t actually require inheritance and can be written elegantly in idiomatic rust.

You may request a code review in the Rust subreddit, and there is a dedicated subreddit for game development in Rust. Welcome to the community. :slight_smile:


#4

Thanks for the help.


#5

Sorry I had not noticed that.