Chapter 20: Object-Oriented Programming
Object-Oriented Programming (OOP) is often associated with class-based design, where objects encapsulate both data and methods, and inheritance structures relationships between types. Although OOP can be effective for many problems, Rust takes a more flexible approach by focusing on composition, traits, and modules rather than on traditional class hierarchies.
From a design standpoint, Rust does support some key OOP features, such as methods, the ability to hide implementation details, and an approach to polymorphism via traits. However, Rust chooses not to rely on classical inheritance or to position OOP as its primary design paradigm.