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

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

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<'a>)

An animation that will replace the old media.

Audio(Audio<'a>)

An audio that will replace the old media.

Document(Document<'a>)

A document that will replace the old media.

Photo(Photo<'a>)

A photo that will replace the old media.

Video(Video<'a>)

A video that will replace the old media.

Implementations

impl<'a> EditableMedia<'a>[src]

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

Returns true if self is of variant Animation.

pub fn expect_animation(self) -> Animation<'a> 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<'a>>[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<'a> 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<'a>>[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<'a> 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<'a>>[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<'a> 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<'a>>[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<'a> 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<'a>>[src]

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

Trait Implementations

impl<'a> Clone for EditableMedia<'a>[src]

impl<'a> Copy for EditableMedia<'a>[src]

impl<'a> Debug for EditableMedia<'a>[src]

impl<'a> Eq for EditableMedia<'a>[src]

impl<'a> From<Animation<'a>> for EditableMedia<'a>[src]

impl<'a> From<Audio<'a>> for EditableMedia<'a>[src]

impl<'a> From<Document<'a>> for EditableMedia<'a>[src]

impl<'a> From<Photo<'a>> for EditableMedia<'a>[src]

impl<'a> From<Video<'a>> for EditableMedia<'a>[src]

impl<'a> Hash for EditableMedia<'a>[src]

impl<'a> PartialEq<EditableMedia<'a>> for EditableMedia<'a>[src]

impl<'a> Serialize for EditableMedia<'a>[src]

impl<'a> StructuralEq for EditableMedia<'a>[src]

impl<'a> StructuralPartialEq for EditableMedia<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for EditableMedia<'a>

impl<'a> Send for EditableMedia<'a>

impl<'a> Sync for EditableMedia<'a>

impl<'a> Unpin for EditableMedia<'a>

impl<'a> UnwindSafe for EditableMedia<'a>

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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?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> 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]