Add setters to Venue
@@ -24,3 +24,51 @@ pub struct Venue {
/// `food/icecream`.)
pub foursquare_type: Option<String>,
}
+
+impl Venue {
+ pub fn new<S1, S2>(location: Location, title: S1, address: S2) -> Self
+ where
+ S1: Into<String>,
+ S2: Into<String>,
+ {
+ Self {
+ location,
+ title: title.into(),
+ address: address.into(),
+ foursquare_id: None,
+ foursquare_type: None,
+ }
+ }
+
+ pub fn title<S>(mut self, val: S) -> Self
+ where
+ S: Into<String>,
+ {
+ self.title = val.into();
+ self
+ }
+
+ pub fn address<S>(mut self, val: S) -> Self
+ where
+ S: Into<String>,
+ {
+ self.address = val.into();
+ self
+ }
+
+ pub fn foursquare_id<S>(mut self, val: S) -> Self
+ where
+ S: Into<String>,
+ {
+ self.foursquare_id = Some(val.into());
+ self
+ }
+
+ pub fn foursquare_type<S>(mut self, val: S) -> Self
+ where
+ S: Into<String>,
+ {
+ self.foursquare_type = Some(val.into());
+ self
+ }
+}
