Rust supports Object-Oriented Programming (OOP) principles, such as encapsulation, polymorphism, and modularity, though it differs from traditional OOP languages by not having classes.

  1. Encapsulation: Achieved using struct for data and impl blocks for associated methods. Private fields and methods enforce controlled access.
  2. Polymorphism: Implemented via traits, allowing shared behavior across types. Dynamic dispatch is supported through trait objects (dyn Trait).
  3. Inheritance: Rust doesn’t have classical inheritance but achieves composability and code reuse via trait bounds and generics.

Rust embraces OOP in a way that complements its ownership and safety model, focusing on performance and minimal abstraction overhead.