mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-31 16:40:37 +01:00
Add setters to PassportFile
This commit is contained in:
parent
a505cd72c1
commit
8e9b0b2715
1 changed files with 41 additions and 0 deletions
|
@ -23,3 +23,44 @@ pub struct PassportFile {
|
|||
/// Unix time when the file was uploaded.
|
||||
pub file_date: u64,
|
||||
}
|
||||
|
||||
impl PassportFile {
|
||||
pub fn new<S1, S2>(file_id: S1, file_unique_id: S2, file_size: u64, file_date: u64) -> Self
|
||||
where
|
||||
S1: Into<String>,
|
||||
S2: Into<String>,
|
||||
{
|
||||
Self {
|
||||
file_id: file_id.into(),
|
||||
file_unique_id: file_unique_id.into(),
|
||||
file_size,
|
||||
file_date,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn file_id<S>(mut self, val: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
self.file_id = val.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn file_unique_id<S>(mut self, val: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
self.file_unique_id = val.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn file_size(mut self, val: u64) -> Self {
|
||||
self.file_size = val;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn file_date(mut self, val: u64) -> Self {
|
||||
self.file_date = val;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue