mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-24 23:57:38 +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,
|
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)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
#[allow(clippy::large_enum_variant)]
|
#[allow(clippy::large_enum_variant)]
|
||||||
|
|
Loading…
Add table
Reference in a new issue