I have a Point3D struct that I have implemented
pub struct Point3D<T> {
pub x: T,
pub y: T,
pub z: T
}
In the course of my program I have to flatten this into a Vec and use the data in this format. What would be the most efficient/idiomatic way to do this? I have seen the From and Into traits and the idea of doing something like
Vec<Point3D<f32>> my_vec;
fn use_vector_of_points(in_data: Vec<f32>);
use_vector_of_points(my_vec.into());
If this is the best way, how would I implement the necessary traits to do this, if this is not the best way to do this, then how ought I do do this?