rust/integral-geometry/src/lib.rs
changeset 14072 8a0d69c16cad
parent 13971 48796bef9e69
child 14073 9c817b2eedae
--- a/rust/integral-geometry/src/lib.rs	Mon Oct 29 23:06:18 2018 +0100
+++ b/rust/integral-geometry/src/lib.rs	Wed Oct 31 23:36:05 2018 +0100
@@ -73,6 +73,22 @@
 bin_assign_op_impl!(MulAssign, mul_assign);
 bin_assign_op_impl!(DivAssign, div_assign);
 
+#[derive(PartialEq, Eq, Clone, Copy, Debug)]
+pub struct Rect {
+    pub x: i32,
+    pub y: i32,
+    pub width: u32,
+    pub height: u32,
+}
+
+impl Rect {
+    #[inline]
+    pub fn new(x: i32, y: i32, width: u32, height: u32) -> Self {
+        Self { x, y, width, height }
+    }
+}
+
+
 pub struct LinePoints {
     accumulator: Point,
     direction: Point,