322 B
322 B
Inheritance and Polymorphism
Rust does not allow extending classes. Instead the base class is stored as a field in the extending class. Polymorphism can then be achieved by passing the field instead of the whole object to a function. Although casting back to the advanced class or overriding functions is not possible.