oop-examples/rust/Inheritance.md

7 lines
322 B
Markdown
Raw Permalink Normal View History

2020-05-24 19:13:09 +02:00
# Inheritance and Polymorphism
2020-05-24 17:04:37 +02:00
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.