- Hello. Welcome to Lesson 12.
In this lesson, we look at traits which are similar
to interfaces in other OO languages.
We'll begin with a look at how to define a trait
and how to implement it in a structure.
Then we'll see how to use traits to achieve inheritance
and polymorphism in Rust.
We'll also see how a trait can inherit from other traits
to achieve a hierarchy of functionality.
For the remainder of the lesson,
we'll take a look at some of the standard traits
in the Rust Library, and we'll see how and why
to implement them in your structures.
We'll see the display trait, the debug trait,
the drop trait, the clone trait, and the copy trait.
Knowing about these traits
will give you a much better understanding
about how Rust works internally as a language.