1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/// Point: Define a point on a 2D canvas. #[derive(Debug, Clone, Copy)] pub struct Point { x: i32, y: i32, } impl Point { #[inline] pub fn new(x: i32, y: i32) -> Point { Point { x: x, y: y } } #[inline] pub fn x(&self) -> i32 { self.x } #[inline] pub fn y(&self) -> i32 { self.y } }