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

19. Object-Oriented Programming

Carlo Milanesi1 
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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.