Traits Flashcards
1
Q
What is Trait
A
A trait is a collection of methods defined for an unknown type: Self. They can access other methods declared in the same trait
2
Q
What is a Trait Object
A
A trait object in Rust is a two-word object that contains:
A pointer to the data (instance of a type that implements the trait)