pub enum InlineKeyboardButtonType {
Buy(InlineKeyboardButtonTypeBuy),
Callback(InlineKeyboardButtonTypeCallback),
CallbackGame(InlineKeyboardButtonTypeCallbackGame),
CallbackWithPassword(InlineKeyboardButtonTypeCallbackWithPassword),
LoginUrl(InlineKeyboardButtonTypeLoginUrl),
SwitchInline(InlineKeyboardButtonTypeSwitchInline),
Url(InlineKeyboardButtonTypeUrl),
User(InlineKeyboardButtonTypeUser),
// some variants omitted
}Expand description
Describes the type of an inline keyboard button
Variants§
Buy(InlineKeyboardButtonTypeBuy)
A button to buy something. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageInvoice
Callback(InlineKeyboardButtonTypeCallback)
A button that sends a callback query to a bot
CallbackGame(InlineKeyboardButtonTypeCallbackGame)
A button with a game that sends a callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame
CallbackWithPassword(InlineKeyboardButtonTypeCallbackWithPassword)
A button that asks for password of the current user and then sends a callback query to a bot
LoginUrl(InlineKeyboardButtonTypeLoginUrl)
A button that opens a specified URL and automatically authorize the current user if allowed to do so
SwitchInline(InlineKeyboardButtonTypeSwitchInline)
A button that forces an inline query to the bot to be inserted in the input field
Url(InlineKeyboardButtonTypeUrl)
A button that opens a specified URL
User(InlineKeyboardButtonTypeUser)
A button with a user reference to be handled in the same way as textEntityTypeMentionName entities
Implementations§
Source§impl InlineKeyboardButtonType
impl InlineKeyboardButtonType
pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self>
pub fn is_buy(&self) -> bool
pub fn is_callback(&self) -> bool
pub fn is_callback_game(&self) -> bool
pub fn is_callback_with_password(&self) -> bool
pub fn is_login_url(&self) -> bool
pub fn is_switch_inline(&self) -> bool
pub fn is_url(&self) -> bool
pub fn is_user(&self) -> bool
pub fn on_buy<F: FnOnce(&InlineKeyboardButtonTypeBuy)>(&self, fnc: F) -> &Self
pub fn on_callback<F: FnOnce(&InlineKeyboardButtonTypeCallback)>( &self, fnc: F, ) -> &Self
pub fn on_callback_game<F: FnOnce(&InlineKeyboardButtonTypeCallbackGame)>( &self, fnc: F, ) -> &Self
pub fn on_callback_with_password<F: FnOnce(&InlineKeyboardButtonTypeCallbackWithPassword)>( &self, fnc: F, ) -> &Self
pub fn on_login_url<F: FnOnce(&InlineKeyboardButtonTypeLoginUrl)>( &self, fnc: F, ) -> &Self
pub fn on_switch_inline<F: FnOnce(&InlineKeyboardButtonTypeSwitchInline)>( &self, fnc: F, ) -> &Self
pub fn on_url<F: FnOnce(&InlineKeyboardButtonTypeUrl)>(&self, fnc: F) -> &Self
pub fn on_user<F: FnOnce(&InlineKeyboardButtonTypeUser)>(&self, fnc: F) -> &Self
pub fn as_buy(&self) -> Option<&InlineKeyboardButtonTypeBuy>
pub fn as_callback(&self) -> Option<&InlineKeyboardButtonTypeCallback>
pub fn as_callback_game(&self) -> Option<&InlineKeyboardButtonTypeCallbackGame>
pub fn as_callback_with_password( &self, ) -> Option<&InlineKeyboardButtonTypeCallbackWithPassword>
pub fn as_login_url(&self) -> Option<&InlineKeyboardButtonTypeLoginUrl>
pub fn as_switch_inline(&self) -> Option<&InlineKeyboardButtonTypeSwitchInline>
pub fn as_url(&self) -> Option<&InlineKeyboardButtonTypeUrl>
pub fn as_user(&self) -> Option<&InlineKeyboardButtonTypeUser>
pub fn buy<T: AsRef<InlineKeyboardButtonTypeBuy>>(t: T) -> Self
pub fn callback<T: AsRef<InlineKeyboardButtonTypeCallback>>(t: T) -> Self
pub fn callback_game<T: AsRef<InlineKeyboardButtonTypeCallbackGame>>( t: T, ) -> Self
pub fn callback_with_password<T: AsRef<InlineKeyboardButtonTypeCallbackWithPassword>>( t: T, ) -> Self
pub fn login_url<T: AsRef<InlineKeyboardButtonTypeLoginUrl>>(t: T) -> Self
pub fn switch_inline<T: AsRef<InlineKeyboardButtonTypeSwitchInline>>( t: T, ) -> Self
pub fn url<T: AsRef<InlineKeyboardButtonTypeUrl>>(t: T) -> Self
pub fn user<T: AsRef<InlineKeyboardButtonTypeUser>>(t: T) -> Self
Trait Implementations§
Source§impl AsRef<InlineKeyboardButtonType> for InlineKeyboardButtonType
impl AsRef<InlineKeyboardButtonType> for InlineKeyboardButtonType
Source§fn as_ref(&self) -> &InlineKeyboardButtonType
fn as_ref(&self) -> &InlineKeyboardButtonType
Source§impl Clone for InlineKeyboardButtonType
impl Clone for InlineKeyboardButtonType
Source§fn clone(&self) -> InlineKeyboardButtonType
fn clone(&self) -> InlineKeyboardButtonType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more