I read through the trait documentation and found a neat definition for using traits on structs. Is it possible to use traits on enum
types? I have seen answers
Can traits be used on enum types?
Yes. In fact, you already have multiple traits defined for your enum; the traits Debug, Copy and Clone:
#[derive(Debug, Copy, Clone)] pub enum SceneType
The problem is that you aren't attempting to implement Playable
for your enum, you are trying to implement it for one of the enum's variants. Enum variants are not types.
As the error message tells you:
help: you can try using the variant's enum: `SceneType`
impl Playable for SceneType {
fn play() {}
}
See also: