I have a struct with generic T for which I want to create a vector of instances of this struct, where for each instance T can be different. I realise I probably need to use a box and possibly need to treat my struct as a trait object, but I am not sure how, since it is not a collection of different structs which implement the same trait, but instead the same struct with a different generic. Below is what I have so far and hopefully illustrates what I am trying to achive, it doesn't work because the dyn keyword seems to expect a trait rather than a generic struct.
struct Point<T> {
x: T,
y: T,
}
struct Points {
points: Vec<Box<dyn Point>>,
}
fn main() {
let points = Points {
points: vec![Point { x: 1, y: 2 }, Point { x: 1.1, y: 2.2 }],
};
}