tbot/types/passport/file.rs
1use crate::types::file::{self, id::AsFileId};
2use serde::Deserialize;
3
4/// Represents a [`PassportFile`][docs].
5///
6/// [docs]: https://core.telegram.org/bots/api#passportfile
7#[derive(Debug, PartialEq, Eq, Clone, Hash, Deserialize)]
8#[non_exhaustive]
9pub struct File {
10 /// The ID of the file.
11 pub id: file::Id,
12 /// The unique ID of the file.
13 pub unique_id: String,
14 /// The size of the file.
15 pub size: usize,
16 /// The date of the file.
17 pub date: i64,
18}
19
20impl crate::internal::Sealed for File {}
21
22impl AsFileId for File {
23 #[must_use]
24 fn as_file_id(&self) -> file::id::Ref<'_> {
25 self.id.as_ref()
26 }
27}