mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
Add setters to EncryptedPassportElement
This commit is contained in:
parent
f5144ec5cd
commit
5353cff3ed
1 changed files with 22 additions and 0 deletions
|
@ -20,6 +20,28 @@ pub struct EncryptedPassportElement {
|
|||
pub kind: EncryptedPassportElementKind,
|
||||
}
|
||||
|
||||
impl EncryptedPassportElement {
|
||||
pub fn new<S>(hash: S, kind: EncryptedPassportElementKind) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
Self { hash: hash.into(), kind }
|
||||
}
|
||||
|
||||
pub fn hash<S>(mut self, val: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
self.hash = val.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn kind(mut self, val: EncryptedPassportElementKind) -> Self {
|
||||
self.kind = val;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
|
|
Loading…
Reference in a new issue