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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly