Enum tbot::types::input_file::EditableMedia
source · #[non_exhaustive]
pub enum EditableMedia {
Animation(Animation),
Audio(Audio),
Document(Document),
Photo(Photo),
Video(Video),
}
Expand description
Represents media that can be used to edit a message.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Animation(Animation)
An animation that will replace the old media.
Audio(Audio)
An audio that will replace the old media.
Document(Document)
A document that will replace the old media.
Photo(Photo)
A photo that will replace the old media.
Video(Video)
A video that will replace the old media.
Implementations§
source§impl EditableMedia
impl EditableMedia
sourcepub fn is_animation(&self) -> bool
pub fn is_animation(&self) -> bool
Returns true
if self
is of variant Animation
.
sourcepub fn expect_animation(self) -> Animationwhere
Self: Debug,
pub fn expect_animation(self) -> Animationwhere
Self: Debug,
sourcepub fn animation(self) -> Option<Animation>
pub fn animation(self) -> Option<Animation>
Returns Some
if self
is of variant Animation
, and None
otherwise.
sourcepub fn expect_audio(self) -> Audiowhere
Self: Debug,
pub fn expect_audio(self) -> Audiowhere
Self: Debug,
sourcepub fn audio(self) -> Option<Audio>
pub fn audio(self) -> Option<Audio>
Returns Some
if self
is of variant Audio
, and None
otherwise.
sourcepub fn is_document(&self) -> bool
pub fn is_document(&self) -> bool
Returns true
if self
is of variant Document
.
sourcepub fn expect_document(self) -> Documentwhere
Self: Debug,
pub fn expect_document(self) -> Documentwhere
Self: Debug,
sourcepub fn document(self) -> Option<Document>
pub fn document(self) -> Option<Document>
Returns Some
if self
is of variant Document
, and None
otherwise.
sourcepub fn expect_photo(self) -> Photowhere
Self: Debug,
pub fn expect_photo(self) -> Photowhere
Self: Debug,
sourcepub fn photo(self) -> Option<Photo>
pub fn photo(self) -> Option<Photo>
Returns Some
if self
is of variant Photo
, and None
otherwise.
sourcepub fn expect_video(self) -> Videowhere
Self: Debug,
pub fn expect_video(self) -> Videowhere
Self: Debug,
Trait Implementations§
source§impl Clone for EditableMedia
impl Clone for EditableMedia
source§fn clone(&self) -> EditableMedia
fn clone(&self) -> EditableMedia
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for EditableMedia
impl Debug for EditableMedia
source§impl From<Animation> for EditableMedia
impl From<Animation> for EditableMedia
source§impl From<Audio> for EditableMedia
impl From<Audio> for EditableMedia
source§impl From<Document> for EditableMedia
impl From<Document> for EditableMedia
source§impl From<Photo> for EditableMedia
impl From<Photo> for EditableMedia
source§impl From<Video> for EditableMedia
impl From<Video> for EditableMedia
source§impl Hash for EditableMedia
impl Hash for EditableMedia
source§impl PartialEq<EditableMedia> for EditableMedia
impl PartialEq<EditableMedia> for EditableMedia
source§fn eq(&self, other: &EditableMedia) -> bool
fn eq(&self, other: &EditableMedia) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.