Enum tbot::types::input_file::MediaGroup[][src]

#[non_exhaustive]
#[must_use]pub enum MediaGroup {
    PhotosAndVideos(Vec<PhotoOrVideo>),
    Audios(Vec<Audio>),
    Documents(Vec<Document>),
}

Represents a possible media group.

Variants (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

impl MediaGroup[src]

pub fn is_photos_and_videos(&self) -> bool[src]

Returns true if self is of variant PhotosAndVideos.

pub fn expect_photos_and_videos(self) -> Vec<PhotoOrVideo> where
    Self: Debug
[src]

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.

pub fn photos_and_videos(self) -> Option<Vec<PhotoOrVideo>>[src]

Returns Some if self is of variant PhotosAndVideos, and None otherwise.

pub fn is_audios(&self) -> bool[src]

Returns true if self is of variant Audios.

pub fn expect_audios(self) -> Vec<Audio> where
    Self: Debug
[src]

Unwraps the value, yielding the content of Audios.

Panics

Panics if the value is not Audios, with a panic message including the content of self.

pub fn audios(self) -> Option<Vec<Audio>>[src]

Returns Some if self is of variant Audios, and None otherwise.

pub fn is_documents(&self) -> bool[src]

Returns true if self is of variant Documents.

pub fn expect_documents(self) -> Vec<Document> where
    Self: Debug
[src]

Unwraps the value, yielding the content of Documents.

Panics

Panics if the value is not Documents, with a panic message including the content of self.

pub fn documents(self) -> Option<Vec<Document>>[src]

Returns Some if self is of variant Documents, and None otherwise.

Trait Implementations

impl Clone for MediaGroup[src]

impl Debug for MediaGroup[src]

impl Eq for MediaGroup[src]

impl From<Vec<Audio, Global>> for MediaGroup[src]

impl From<Vec<Document, Global>> for MediaGroup[src]

impl From<Vec<PhotoOrVideo, Global>> for MediaGroup[src]

impl Hash for MediaGroup[src]

impl PartialEq<MediaGroup> for MediaGroup[src]

impl StructuralEq for MediaGroup[src]

impl StructuralPartialEq for MediaGroup[src]

Auto Trait Implementations

impl RefUnwindSafe for MediaGroup

impl Send for MediaGroup

impl Sync for MediaGroup

impl Unpin for MediaGroup

impl UnwindSafe for MediaGroup

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithSubscriber for T[src]