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

#[non_exhaustive]
#[must_use]
pub enum EditableMedia {
    Animation(Animation),
    Audio(Audio),
    Document(Document),
    Photo(Photo),
    Video(Video),
}

Represents media that can be used to edit a message.

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.
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

impl EditableMedia[src]

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

Returns true if self is of variant Animation.

pub fn expect_animation(self) -> Animation where
    Self: Debug
[src]

Unwraps the value, yielding the content of Animation.

Panics

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

pub fn animation(self) -> Option<Animation>[src]

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

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

Returns true if self is of variant Audio.

pub fn expect_audio(self) -> Audio where
    Self: Debug
[src]

Unwraps the value, yielding the content of Audio.

Panics

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

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

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

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

Returns true if self is of variant Document.

pub fn expect_document(self) -> Document where
    Self: Debug
[src]

Unwraps the value, yielding the content of Document.

Panics

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

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

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

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

Returns true if self is of variant Photo.

pub fn expect_photo(self) -> Photo where
    Self: Debug
[src]

Unwraps the value, yielding the content of Photo.

Panics

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

pub fn photo(self) -> Option<Photo>[src]

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

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

Returns true if self is of variant Video.

pub fn expect_video(self) -> Video where
    Self: Debug
[src]

Unwraps the value, yielding the content of Video.

Panics

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

pub fn video(self) -> Option<Video>[src]

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

Trait Implementations

impl Clone for EditableMedia[src]

impl Debug for EditableMedia[src]

impl From<Animation> for EditableMedia[src]

impl From<Audio> for EditableMedia[src]

impl From<Document> for EditableMedia[src]

impl From<Photo> for EditableMedia[src]

impl From<Video> for EditableMedia[src]

impl Hash for EditableMedia[src]

impl PartialEq<EditableMedia> for EditableMedia[src]

impl Serialize for EditableMedia[src]

impl Eq for EditableMedia[src]

impl StructuralEq for EditableMedia[src]

impl StructuralPartialEq for EditableMedia[src]

Auto Trait Implementations

impl RefUnwindSafe for EditableMedia

impl Send for EditableMedia

impl Sync for EditableMedia

impl Unpin for EditableMedia

impl UnwindSafe for EditableMedia

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, 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.