© Carlo Milanesi 2018
Carlo MilanesiBeginning Rusthttps://doi.org/10.1007/978-1-4842-3468-6_19

19. Object-Oriented Programming

Carlo Milanesi1 
(1)
Bergamo, Italy
 
In this chapter, you will learn:
  • How to associate functions to types without using traits, with inherent implementations

  • How Rust object-orientation differs from C++ object-orientation

  • Which traits can be implemented on which types, and which cannot

  • How to specify that a method can mutate the object on which it is applied

  • Some conventions regarding the methods that construct objects

  • Why Rust does not use data inheritance

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

Inherent Implementations

In the previous chapter, we saw how to solve the following ...

Get Beginning Rust: From Novice to Professional 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.