© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
C. MilanesiBeginning Rusthttps://doi.org/10.1007/978-1-4842-7208-4_20

20. Object-Oriented Programming

Carlo Milanesi1  
(1)
Bergamo, Italy
 
In this chapter, you will learn:
  • How to implement destructors, that is, methods to run when an object is deallocated

  • How to implement operator overloading, that is, methods that allow use of Rust operators with user-defined types

  • How to implement infallible or fallible type converters

  • Why Rust does not use data inheritance and how to do without it

  • What are static dispatch and dynamic dispatch, how they are implemented, and when to use them

Peculiarities of Rust Object-Orientation

In previous chapters, we have already seen that ...

Get Beginning Rust: Get Started with Rust 2021 Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.