[][src]Enum tbot::types::message::inline_markup::ButtonKind

#[non_exhaustive]pub enum ButtonKind {
    Url(String),
    CallbackData(String),
    SwitchInlineQuery(String),
    SwitchInlineQueryCurrentChat(String),
    CallbackGame(Game),
    Pay(bool),
}

Represents different types an inline button can be.

Complete descriptions can be found in Bots API docs.

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.
Url(String)

Represents a URL button.

CallbackData(String)

Represents callback data.

SwitchInlineQuery(String)

Represents query inserted when switched to inline.

SwitchInlineQueryCurrentChat(String)

Represents query inserted when switched to inline in the curent chat.

CallbackGame(Game)

Represent a description of the game to be laucnhed.

Pay(bool)

if true, a pay button.

Implementations

impl ButtonKind[src]

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

Returns true if self is of variant Url.

pub fn expect_url(self) -> String where
    Self: Debug
[src]

Unwraps the value, yielding the content of Url.

Panics

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

pub fn url(self) -> Option<String>[src]

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

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

Returns true if self is of variant CallbackData.

pub fn expect_callback_data(self) -> String where
    Self: Debug
[src]

Unwraps the value, yielding the content of CallbackData.

Panics

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

pub fn callback_data(self) -> Option<String>[src]

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

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

Returns true if self is of variant SwitchInlineQuery.

pub fn expect_switch_inline_query(self) -> String where
    Self: Debug
[src]

Unwraps the value, yielding the content of SwitchInlineQuery.

Panics

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

pub fn switch_inline_query(self) -> Option<String>[src]

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

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

Returns true if self is of variant SwitchInlineQueryCurrentChat.

pub fn expect_switch_inline_query_current_chat(self) -> String where
    Self: Debug
[src]

Unwraps the value, yielding the content of SwitchInlineQueryCurrentChat.

Panics

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

pub fn switch_inline_query_current_chat(self) -> Option<String>[src]

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

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

Returns true if self is of variant CallbackGame.

pub fn expect_callback_game(self) -> Game where
    Self: Debug
[src]

Unwraps the value, yielding the content of CallbackGame.

Panics

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

pub fn callback_game(self) -> Option<Game>[src]

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

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

Returns true if self is of variant Pay.

pub fn expect_pay(self) -> bool where
    Self: Debug
[src]

Unwraps the value, yielding the content of Pay.

Panics

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

pub fn pay(self) -> Option<bool>[src]

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

Trait Implementations

impl Clone for ButtonKind[src]

impl Debug for ButtonKind[src]

impl Eq for ButtonKind[src]

impl Hash for ButtonKind[src]

impl PartialEq<ButtonKind> for ButtonKind[src]

impl StructuralEq for ButtonKind[src]

impl StructuralPartialEq for ButtonKind[src]

Auto Trait Implementations

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]