bolt_proto/value/
point_2d.rs1use bolt_proto_derive::*;
2
3use crate::value::SIGNATURE_POINT_2D;
4
5#[bolt_structure(SIGNATURE_POINT_2D)]
6#[derive(Debug, Clone, PartialEq)]
7pub struct Point2D {
8 pub(crate) srid: i32,
9 pub(crate) x: f64,
10 pub(crate) y: f64,
11}
12
13impl Point2D {
14 pub fn new(srid: i32, x: f64, y: f64) -> Self {
15 Self { srid, x, y }
16 }
17
18 pub fn srid(&self) -> i32 {
19 self.srid
20 }
21
22 pub fn x(&self) -> f64 {
23 self.x
24 }
25
26 pub fn y(&self) -> f64 {
27 self.y
28 }
29}