October 2018
Beginner
180 pages
4h 48m
English
A trait is a name and formal definition for a specific bit of functionality that a data type may provide. Previously, we've talked about how data types might have the Copy trait, and how, when they do, the compiler copies them instead of moving them. That is the general idea: when a trait is implemented for a data type, that data type gains the ability to interact with the rest of the program in some specific way.
That's all very abstract, so let's get more concrete by looking at the same "driving directions" problem ...
Read now
Unlock full access