I'm trying to use a trait as a field in my struct:
pub trait Scene {
type Renderer;
fn update(&mut self);
fn render(&mut self, r: &mut Self::Renderer);
}
struct Example {
active_scene: *mut Scene,
}
When I try to use it, I get the error:
error[E0191]: the value of the associated type `Renderer` (from the trait `Scene`) must be specified
--> src/lib.rs:9:24
|
9 | active_scene: *mut Scene,
| ^^^^^ missing associated type `Renderer` value
How do I specify the types in a field? Is there something obvious I'm missing?