pub trait SetXY { // Required methods fn set_x(&mut self, x: f64); fn set_y(&mut self, y: f64); // Provided method fn set_xy(&mut self, x: f64, y: f64) { ... } }
Trait to set the x and y values
Set the x value
Set the y value
Set both x and y