On inheritance and why it's good Rust doesn't have it
https://www.thecodedmessage.com/posts/oop-3-inheritance/
Discussions: https://discu.eu/q/https://www.thecodedmessage.com/posts/oop-3-inheritance/
Rust Is Beyond Object-Oriented, Part 3: Inheritance :: The Coded Message - discu.eu
Discussions and related articles for «Rust Is Beyond Object-Oriented, Part 3: Inheritance :: The Coded Message»discu.eu
modulux
in reply to Rust Weekly 🦀 • • •Just noticed this in the article that I think is not accurate:
"There is no inheritance in Rust. There are no fields in traits. There is simply no way of saying that in order to implement a trait, your type must have certain fields."
Traits can have implemented methods taking self, and if those methods refer to fields in self type-checking won't allow a struct to implement that trait without having those fields, no?