Struct tg_flows::InlineKeyboardButton
source · pub struct InlineKeyboardButton {
pub text: String,
pub kind: InlineKeyboardButtonKind,
}Expand description
This object represents one button of an inline keyboard.
Fields§
§text: StringLabel text on the button.
kind: InlineKeyboardButtonKindImplementations§
source§impl InlineKeyboardButton
impl InlineKeyboardButton
sourcepub fn new<S>(text: S, kind: InlineKeyboardButtonKind) -> Selfwhere
S: Into<String>,
pub fn new<S>(text: S, kind: InlineKeyboardButtonKind) -> Selfwhere S: Into<String>,
Creates a new InlineKeyboardButton.
sourcepub fn url<T>(text: T, url: Url) -> Selfwhere
T: Into<String>,
pub fn url<T>(text: T, url: Url) -> Selfwhere T: Into<String>,
Constructor for InlineKeyboardButton with Url kind.
sourcepub fn login<T>(text: T, url: LoginUrl) -> Selfwhere
T: Into<String>,
pub fn login<T>(text: T, url: LoginUrl) -> Selfwhere T: Into<String>,
Constructor for InlineKeyboardButton with LoginUrl kind.
sourcepub fn callback<T, C>(text: T, callback_data: C) -> Selfwhere
T: Into<String>,
C: Into<String>,
pub fn callback<T, C>(text: T, callback_data: C) -> Selfwhere T: Into<String>, C: Into<String>,
Constructor for InlineKeyboardButton with CallbackData kind.
sourcepub fn web_app<T>(text: T, info: WebAppInfo) -> Selfwhere
T: Into<String>,
pub fn web_app<T>(text: T, info: WebAppInfo) -> Selfwhere T: Into<String>,
Constructor for InlineKeyboardButton with WebApp kind.
sourcepub fn switch_inline_query<T, Q>(text: T, switch_inline_query: Q) -> Selfwhere
T: Into<String>,
Q: Into<String>,
pub fn switch_inline_query<T, Q>(text: T, switch_inline_query: Q) -> Selfwhere T: Into<String>, Q: Into<String>,
Constructor for InlineKeyboardButton with SwitchInlineQuery kind.
sourcepub fn switch_inline_query_current_chat<T, Q>(
text: T,
switch_inline_query_current_chat: Q
) -> Selfwhere
T: Into<String>,
Q: Into<String>,
pub fn switch_inline_query_current_chat<T, Q>( text: T, switch_inline_query_current_chat: Q ) -> Selfwhere T: Into<String>, Q: Into<String>,
Constructor for InlineKeyboardButton with
SwitchInlineQueryCurrentChat kind.
sourcepub fn callback_game<T>(text: T, game: CallbackGame) -> Selfwhere
T: Into<String>,
pub fn callback_game<T>(text: T, game: CallbackGame) -> Selfwhere T: Into<String>,
Constructor for InlineKeyboardButton with CallbackGame kind.
source§impl InlineKeyboardButton
impl InlineKeyboardButton
pub fn text<S>(self, val: S) -> Selfwhere S: Into<String>,
👎Deprecated since 0.7.0: set correct text in the constructor or access the field directly
pub fn kind(self, val: InlineKeyboardButtonKind) -> Self
👎Deprecated since 0.7.0: set correct kind in the constructor or access the field directly
Trait Implementations§
source§impl Clone for InlineKeyboardButton
impl Clone for InlineKeyboardButton
source§fn clone(&self) -> InlineKeyboardButton
fn clone(&self) -> InlineKeyboardButton
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for InlineKeyboardButton
impl Debug for InlineKeyboardButton
source§impl<'de> Deserialize<'de> for InlineKeyboardButton
impl<'de> Deserialize<'de> for InlineKeyboardButton
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for InlineKeyboardButton
impl Hash for InlineKeyboardButton
source§impl PartialEq<InlineKeyboardButton> for InlineKeyboardButton
impl PartialEq<InlineKeyboardButton> for InlineKeyboardButton
source§fn eq(&self, other: &InlineKeyboardButton) -> bool
fn eq(&self, other: &InlineKeyboardButton) -> bool
This method tests for
self and other values to be equal, and is used
by ==.