Enum tbot::types::input_file::MediaGroup
source · #[non_exhaustive]
pub enum MediaGroup {
PhotosAndVideos(Vec<PhotoOrVideo>),
Audios(Vec<Audio>),
Documents(Vec<Document>),
}
Expand description
Represents a possible media group.
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.
PhotosAndVideos(Vec<PhotoOrVideo>)
An album of photos and videos.
Audios(Vec<Audio>)
A group of audios.
Documents(Vec<Document>)
A group of documents.
Implementations§
source§impl MediaGroup
impl MediaGroup
sourcepub fn is_photos_and_videos(&self) -> bool
pub fn is_photos_and_videos(&self) -> bool
Returns true
if self
is of variant PhotosAndVideos
.
sourcepub fn expect_photos_and_videos(self) -> Vec<PhotoOrVideo>where
Self: Debug,
pub fn expect_photos_and_videos(self) -> Vec<PhotoOrVideo>where
Self: Debug,
Unwraps the value, yielding the content of PhotosAndVideos
.
Panics
Panics if the value is not PhotosAndVideos
, with a panic message including the content of self
.
sourcepub fn photos_and_videos(self) -> Option<Vec<PhotoOrVideo>>
pub fn photos_and_videos(self) -> Option<Vec<PhotoOrVideo>>
Returns Some
if self
is of variant PhotosAndVideos
, and None
otherwise.
sourcepub fn expect_audios(self) -> Vec<Audio>where
Self: Debug,
pub fn expect_audios(self) -> Vec<Audio>where
Self: Debug,
sourcepub fn audios(self) -> Option<Vec<Audio>>
pub fn audios(self) -> Option<Vec<Audio>>
Returns Some
if self
is of variant Audios
, and None
otherwise.
sourcepub fn is_documents(&self) -> bool
pub fn is_documents(&self) -> bool
Returns true
if self
is of variant Documents
.
sourcepub fn expect_documents(self) -> Vec<Document>where
Self: Debug,
pub fn expect_documents(self) -> Vec<Document>where
Self: Debug,
Trait Implementations§
source§impl Clone for MediaGroup
impl Clone for MediaGroup
source§fn clone(&self) -> MediaGroup
fn clone(&self) -> MediaGroup
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 MediaGroup
impl Debug for MediaGroup
source§impl From<Vec<PhotoOrVideo, Global>> for MediaGroup
impl From<Vec<PhotoOrVideo, Global>> for MediaGroup
source§fn from(album: Vec<PhotoOrVideo>) -> Self
fn from(album: Vec<PhotoOrVideo>) -> Self
Converts to this type from the input type.
source§impl Hash for MediaGroup
impl Hash for MediaGroup
source§impl PartialEq<MediaGroup> for MediaGroup
impl PartialEq<MediaGroup> for MediaGroup
source§fn eq(&self, other: &MediaGroup) -> bool
fn eq(&self, other: &MediaGroup) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.