[][src]Enum tbot::types::inline_query::result::Kind

#[non_exhaustive]
#[must_use]pub enum Kind<'a> {
    Article(Article<'a>),
    Audio(Audio<'a>),
    Contact(Contact<'a>),
    Document(Document<'a>),
    Game(Game<'a>),
    Gif(Gif<'a>),
    Location(Location<'a>),
    Mpeg4Gif(Mpeg4Gif<'a>),
    Photo(Photo<'a>),
    Sticker(Sticker<'a>),
    Venue(Venue<'a>),
    Video(Video<'a>),
    Voice(Voice<'a>),
}

Represents different kinds of InlineQueryResult.

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.
Article(Article<'a>)

An article.

Audio(Audio<'a>)

An audio.

Contact(Contact<'a>)

A contact.

Document(Document<'a>)

A document.

Game(Game<'a>)

A game.

Gif(Gif<'a>)

A GIF.

Location(Location<'a>)

A location.

Mpeg4Gif(Mpeg4Gif<'a>)

A MPEG-4 GIF.

Photo(Photo<'a>)

A photo.

Sticker(Sticker<'a>)

A sticker.

Venue(Venue<'a>)

A venue.

Video(Video<'a>)

A video.

Voice(Voice<'a>)

A voice.

Implementations

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

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

Returns true if self is of variant Article.

pub fn expect_article(self) -> Article<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of Article.

Panics

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

pub fn article(self) -> Option<Article<'a>>[src]

Returns Some if self is of variant Article, 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_contact(&self) -> bool[src]

Returns true if self is of variant Contact.

pub fn expect_contact(self) -> Contact<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of Contact.

Panics

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

pub fn contact(self) -> Option<Contact<'a>>[src]

Returns Some if self is of variant Contact, 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_game(&self) -> bool[src]

Returns true if self is of variant Game.

pub fn expect_game(self) -> Game<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of Game.

Panics

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

pub fn game(self) -> Option<Game<'a>>[src]

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

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

Returns true if self is of variant Gif.

pub fn expect_gif(self) -> Gif<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of Gif.

Panics

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

pub fn gif(self) -> Option<Gif<'a>>[src]

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

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

Returns true if self is of variant Location.

pub fn expect_location(self) -> Location<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of Location.

Panics

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

pub fn location(self) -> Option<Location<'a>>[src]

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

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

Returns true if self is of variant Mpeg4Gif.

pub fn expect_mpeg4_gif(self) -> Mpeg4Gif<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of Mpeg4Gif.

Panics

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

pub fn mpeg4_gif(self) -> Option<Mpeg4Gif<'a>>[src]

Returns Some if self is of variant Mpeg4Gif, 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_sticker(&self) -> bool[src]

Returns true if self is of variant Sticker.

pub fn expect_sticker(self) -> Sticker<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of Sticker.

Panics

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

pub fn sticker(self) -> Option<Sticker<'a>>[src]

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

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

Returns true if self is of variant Venue.

pub fn expect_venue(self) -> Venue<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of Venue.

Panics

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

pub fn venue(self) -> Option<Venue<'a>>[src]

Returns Some if self is of variant Venue, 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.

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

Returns true if self is of variant Voice.

pub fn expect_voice(self) -> Voice<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of Voice.

Panics

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

pub fn voice(self) -> Option<Voice<'a>>[src]

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

Trait Implementations

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

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

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

impl<'a> From<Article<'a>> for Kind<'a>[src]

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

impl<'a> From<Contact<'a>> for Kind<'a>[src]

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

impl<'a> From<Game<'a>> for Kind<'a>[src]

impl<'a> From<Gif<'a>> for Kind<'a>[src]

impl<'a> From<Location<'a>> for Kind<'a>[src]

impl<'a> From<Mpeg4Gif<'a>> for Kind<'a>[src]

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

impl<'a> From<Sticker<'a>> for Kind<'a>[src]

impl<'a> From<Venue<'a>> for Kind<'a>[src]

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

impl<'a> From<Voice<'a>> for Kind<'a>[src]

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

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

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

Auto Trait Implementations

impl<'a> RefUnwindSafe for Kind<'a>

impl<'a> Send for Kind<'a>

impl<'a> Sync for Kind<'a>

impl<'a> Unpin for Kind<'a>

impl<'a> UnwindSafe for Kind<'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<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> 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]