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) -> Self
pub fn new<S>(text: S, kind: InlineKeyboardButtonKind) -> Self
Creates a new InlineKeyboardButton.
Sourcepub fn login<T>(text: T, url: LoginUrl) -> Self
pub fn login<T>(text: T, url: LoginUrl) -> Self
Constructor for InlineKeyboardButton with LoginUrl kind.
Sourcepub fn callback<T, C>(text: T, callback_data: C) -> Self
pub fn callback<T, C>(text: T, callback_data: C) -> Self
Constructor for InlineKeyboardButton with CallbackData kind.
Sourcepub fn web_app<T>(text: T, info: WebAppInfo) -> Self
pub fn web_app<T>(text: T, info: WebAppInfo) -> Self
Constructor for InlineKeyboardButton with WebApp kind.
Sourcepub fn switch_inline_query<T, Q>(text: T, switch_inline_query: Q) -> Self
pub fn switch_inline_query<T, Q>(text: T, switch_inline_query: Q) -> Self
Constructor for InlineKeyboardButton with SwitchInlineQuery kind.
Sourcepub fn switch_inline_query_current_chat<T, Q>(
text: T,
switch_inline_query_current_chat: Q,
) -> Self
pub fn switch_inline_query_current_chat<T, Q>( text: T, switch_inline_query_current_chat: Q, ) -> Self
Constructor for InlineKeyboardButton with
SwitchInlineQueryCurrentChat kind.
Sourcepub fn callback_game<T>(text: T, game: CallbackGame) -> Self
pub fn callback_game<T>(text: T, game: CallbackGame) -> Self
Constructor for InlineKeyboardButton with CallbackGame kind.
Source§impl InlineKeyboardButton
impl InlineKeyboardButton
pub fn text<S>(self, val: S) -> Self
👎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 duplicate 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 for InlineKeyboardButton
impl PartialEq for InlineKeyboardButton
Source§impl Serialize for InlineKeyboardButton
impl Serialize for InlineKeyboardButton
impl Eq for InlineKeyboardButton
impl StructuralPartialEq for InlineKeyboardButton
Auto Trait Implementations§
impl Freeze for InlineKeyboardButton
impl RefUnwindSafe for InlineKeyboardButton
impl Send for InlineKeyboardButton
impl Sync for InlineKeyboardButton
impl Unpin for InlineKeyboardButton
impl UnwindSafe for InlineKeyboardButton
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more