mirror of
https://github.com/teloxide/teloxide.git
synced 2024-10-24 09:57:18 +02:00
Add setters to Venue
This commit is contained in:
parent
abaff16949
commit
aa311fb96a
1 changed files with 48 additions and 0 deletions
|
@ -24,3 +24,51 @@ pub struct Venue {
|
||||||
/// `food/icecream`.)
|
/// `food/icecream`.)
|
||||||
pub foursquare_type: Option<String>,
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue