diff --git a/src/types/location.rs b/src/types/location.rs index b786847a..e34cee1a 100644 --- a/src/types/location.rs +++ b/src/types/location.rs @@ -10,3 +10,19 @@ pub struct Location { /// Latitude as defined by sender. pub latitude: f64, } + +impl Location { + pub fn new(longitude: f64, latitude: f64) -> Self { + Self { longitude, latitude } + } + + pub fn latitude(mut self, val: f64) -> Self { + self.latitude = val; + self + } + + pub fn longitude(mut self, val: f64) -> Self { + self.longitude = val; + self + } +}