pub enum FileType {
Show 16 variants
Animation(FileTypeAnimation),
Audio(FileTypeAudio),
Document(FileTypeDocument),
None(FileTypeNone),
Photo(FileTypePhoto),
ProfilePhoto(FileTypeProfilePhoto),
Secret(FileTypeSecret),
SecretThumbnail(FileTypeSecretThumbnail),
Secure(FileTypeSecure),
Sticker(FileTypeSticker),
Thumbnail(FileTypeThumbnail),
Unknown(FileTypeUnknown),
Video(FileTypeVideo),
VideoNote(FileTypeVideoNote),
VoiceNote(FileTypeVoiceNote),
Wallpaper(FileTypeWallpaper),
// some variants omitted
}Expand description
Represents the type of a file
Variants§
Animation(FileTypeAnimation)
The file is an animation
Audio(FileTypeAudio)
The file is an audio file
Document(FileTypeDocument)
The file is a document
None(FileTypeNone)
The data is not a file
Photo(FileTypePhoto)
The file is a photo
ProfilePhoto(FileTypeProfilePhoto)
The file is a profile photo
Secret(FileTypeSecret)
The file was sent to a secret chat (the file type is not known to the server)
SecretThumbnail(FileTypeSecretThumbnail)
The file is a thumbnail of a file from a secret chat
Secure(FileTypeSecure)
The file is a file from Secure storage used for storing Telegram Passport files
Sticker(FileTypeSticker)
The file is a sticker
Thumbnail(FileTypeThumbnail)
The file is a thumbnail of another file
Unknown(FileTypeUnknown)
The file type is not yet known
Video(FileTypeVideo)
The file is a video
VideoNote(FileTypeVideoNote)
The file is a video note
VoiceNote(FileTypeVoiceNote)
The file is a voice note
Wallpaper(FileTypeWallpaper)
The file is a wallpaper or a background pattern
Implementations§
Source§impl FileType
impl FileType
pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self>
pub fn is_animation(&self) -> bool
pub fn is_audio(&self) -> bool
pub fn is_document(&self) -> bool
pub fn is_none(&self) -> bool
pub fn is_photo(&self) -> bool
pub fn is_profile_photo(&self) -> bool
pub fn is_secret(&self) -> bool
pub fn is_secret_thumbnail(&self) -> bool
pub fn is_secure(&self) -> bool
pub fn is_sticker(&self) -> bool
pub fn is_thumbnail(&self) -> bool
pub fn is_unknown(&self) -> bool
pub fn is_video(&self) -> bool
pub fn is_video_note(&self) -> bool
pub fn is_voice_note(&self) -> bool
pub fn is_wallpaper(&self) -> bool
pub fn on_animation<F: FnOnce(&FileTypeAnimation)>(&self, fnc: F) -> &Self
pub fn on_audio<F: FnOnce(&FileTypeAudio)>(&self, fnc: F) -> &Self
pub fn on_document<F: FnOnce(&FileTypeDocument)>(&self, fnc: F) -> &Self
pub fn on_none<F: FnOnce(&FileTypeNone)>(&self, fnc: F) -> &Self
pub fn on_photo<F: FnOnce(&FileTypePhoto)>(&self, fnc: F) -> &Self
pub fn on_profile_photo<F: FnOnce(&FileTypeProfilePhoto)>( &self, fnc: F, ) -> &Self
pub fn on_secret<F: FnOnce(&FileTypeSecret)>(&self, fnc: F) -> &Self
pub fn on_secret_thumbnail<F: FnOnce(&FileTypeSecretThumbnail)>( &self, fnc: F, ) -> &Self
pub fn on_secure<F: FnOnce(&FileTypeSecure)>(&self, fnc: F) -> &Self
pub fn on_sticker<F: FnOnce(&FileTypeSticker)>(&self, fnc: F) -> &Self
pub fn on_thumbnail<F: FnOnce(&FileTypeThumbnail)>(&self, fnc: F) -> &Self
pub fn on_unknown<F: FnOnce(&FileTypeUnknown)>(&self, fnc: F) -> &Self
pub fn on_video<F: FnOnce(&FileTypeVideo)>(&self, fnc: F) -> &Self
pub fn on_video_note<F: FnOnce(&FileTypeVideoNote)>(&self, fnc: F) -> &Self
pub fn on_voice_note<F: FnOnce(&FileTypeVoiceNote)>(&self, fnc: F) -> &Self
pub fn on_wallpaper<F: FnOnce(&FileTypeWallpaper)>(&self, fnc: F) -> &Self
pub fn as_animation(&self) -> Option<&FileTypeAnimation>
pub fn as_audio(&self) -> Option<&FileTypeAudio>
pub fn as_document(&self) -> Option<&FileTypeDocument>
pub fn as_none(&self) -> Option<&FileTypeNone>
pub fn as_photo(&self) -> Option<&FileTypePhoto>
pub fn as_profile_photo(&self) -> Option<&FileTypeProfilePhoto>
pub fn as_secret(&self) -> Option<&FileTypeSecret>
pub fn as_secret_thumbnail(&self) -> Option<&FileTypeSecretThumbnail>
pub fn as_secure(&self) -> Option<&FileTypeSecure>
pub fn as_sticker(&self) -> Option<&FileTypeSticker>
pub fn as_thumbnail(&self) -> Option<&FileTypeThumbnail>
pub fn as_unknown(&self) -> Option<&FileTypeUnknown>
pub fn as_video(&self) -> Option<&FileTypeVideo>
pub fn as_video_note(&self) -> Option<&FileTypeVideoNote>
pub fn as_voice_note(&self) -> Option<&FileTypeVoiceNote>
pub fn as_wallpaper(&self) -> Option<&FileTypeWallpaper>
pub fn animation<T: AsRef<FileTypeAnimation>>(t: T) -> Self
pub fn audio<T: AsRef<FileTypeAudio>>(t: T) -> Self
pub fn document<T: AsRef<FileTypeDocument>>(t: T) -> Self
pub fn none<T: AsRef<FileTypeNone>>(t: T) -> Self
pub fn photo<T: AsRef<FileTypePhoto>>(t: T) -> Self
pub fn profile_photo<T: AsRef<FileTypeProfilePhoto>>(t: T) -> Self
pub fn secret<T: AsRef<FileTypeSecret>>(t: T) -> Self
pub fn secret_thumbnail<T: AsRef<FileTypeSecretThumbnail>>(t: T) -> Self
pub fn secure<T: AsRef<FileTypeSecure>>(t: T) -> Self
pub fn sticker<T: AsRef<FileTypeSticker>>(t: T) -> Self
pub fn thumbnail<T: AsRef<FileTypeThumbnail>>(t: T) -> Self
pub fn unknown<T: AsRef<FileTypeUnknown>>(t: T) -> Self
pub fn video<T: AsRef<FileTypeVideo>>(t: T) -> Self
pub fn video_note<T: AsRef<FileTypeVideoNote>>(t: T) -> Self
pub fn voice_note<T: AsRef<FileTypeVoiceNote>>(t: T) -> Self
pub fn wallpaper<T: AsRef<FileTypeWallpaper>>(t: T) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FileType
impl<'de> Deserialize<'de> for FileType
Source§fn deserialize<D>(deserializer: D) -> Result<FileType, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<FileType, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FileType
impl RefUnwindSafe for FileType
impl Send for FileType
impl Sync for FileType
impl Unpin for FileType
impl UnwindSafe for FileType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more