mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
Add setters to PassportData
This commit is contained in:
parent
b2755b96b4
commit
d23c22b064
1 changed files with 22 additions and 0 deletions
|
@ -16,3 +16,25 @@ pub struct PassportData {
|
|||
/// Encrypted credentials required to decrypt the data.
|
||||
pub credentials: EncryptedCredentials,
|
||||
}
|
||||
|
||||
impl PassportData {
|
||||
pub fn new<E>(data: E, credentials: EncryptedCredentials) -> Self
|
||||
where
|
||||
E: Into<Vec<EncryptedPassportElement>>,
|
||||
{
|
||||
Self { data: data.into(), credentials }
|
||||
}
|
||||
|
||||
pub fn data<E>(mut self, val: E) -> Self
|
||||
where
|
||||
E: Into<Vec<EncryptedPassportElement>>,
|
||||
{
|
||||
self.data = val.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn credentials(mut self, val: EncryptedCredentials) -> Self {
|
||||
self.credentials = val;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue