Struct teloxide::types::InlineKeyboardButton
source · pub struct InlineKeyboardButton {
pub text: String,
pub kind: InlineKeyboardButtonKind,
}
Expand description
This object represents one button of an inline keyboard.
Fields§
§text: String
Label text on the button.
kind: InlineKeyboardButtonKind
Implementations§
source§impl InlineKeyboardButton
impl InlineKeyboardButton
sourcepub fn new<S>(text: S, kind: InlineKeyboardButtonKind) -> InlineKeyboardButtonwhere
S: Into<String>,
pub fn new<S>(text: S, kind: InlineKeyboardButtonKind) -> InlineKeyboardButtonwhere
S: Into<String>,
Creates a new InlineKeyboardButton
.
sourcepub fn url<T>(text: T, url: Url) -> InlineKeyboardButtonwhere
T: Into<String>,
pub fn url<T>(text: T, url: Url) -> InlineKeyboardButtonwhere
T: Into<String>,
Constructor for InlineKeyboardButton
with Url
kind.
sourcepub fn login<T>(text: T, url: LoginUrl) -> InlineKeyboardButtonwhere
T: Into<String>,
pub fn login<T>(text: T, url: LoginUrl) -> InlineKeyboardButtonwhere
T: Into<String>,
Constructor for InlineKeyboardButton
with LoginUrl
kind.
sourcepub fn callback<T, C>(text: T, callback_data: C) -> InlineKeyboardButtonwhere
T: Into<String>,
C: Into<String>,
pub fn callback<T, C>(text: T, callback_data: C) -> InlineKeyboardButtonwhere
T: Into<String>,
C: Into<String>,
Constructor for InlineKeyboardButton
with CallbackData
kind.
sourcepub fn web_app<T>(text: T, info: WebAppInfo) -> InlineKeyboardButtonwhere
T: Into<String>,
pub fn web_app<T>(text: T, info: WebAppInfo) -> InlineKeyboardButtonwhere
T: Into<String>,
Constructor for InlineKeyboardButton
with WebApp
kind.
sourcepub fn switch_inline_query<T, Q>(
text: T,
switch_inline_query: Q
) -> InlineKeyboardButtonwhere
T: Into<String>,
Q: Into<String>,
pub fn switch_inline_query<T, Q>(
text: T,
switch_inline_query: Q
) -> InlineKeyboardButtonwhere
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
) -> InlineKeyboardButtonwhere
T: Into<String>,
Q: Into<String>,
pub fn switch_inline_query_current_chat<T, Q>(
text: T,
switch_inline_query_current_chat: Q
) -> InlineKeyboardButtonwhere
T: Into<String>,
Q: Into<String>,
Constructor for InlineKeyboardButton
with
SwitchInlineQueryCurrentChat
kind.
sourcepub fn callback_game<T>(text: T, game: CallbackGame) -> InlineKeyboardButtonwhere
T: Into<String>,
pub fn callback_game<T>(text: T, game: CallbackGame) -> InlineKeyboardButtonwhere
T: Into<String>,
Constructor for InlineKeyboardButton
with CallbackGame
kind.
source§impl InlineKeyboardButton
impl InlineKeyboardButton
pub fn text<S>(self, val: S) -> InlineKeyboardButtonwhere
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) -> InlineKeyboardButton
👎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<InlineKeyboardButton, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<InlineKeyboardButton, <__D as Deserializer<'de>>::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 ==
.source§impl Serialize for InlineKeyboardButton
impl Serialize for InlineKeyboardButton
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for InlineKeyboardButton
impl StructuralEq for InlineKeyboardButton
impl StructuralPartialEq for InlineKeyboardButton
Auto Trait Implementations§
impl RefUnwindSafe for InlineKeyboardButton
impl Send for InlineKeyboardButton
impl Sync for InlineKeyboardButton
impl Unpin for InlineKeyboardButton
impl UnwindSafe for InlineKeyboardButton
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.