pub struct KeyboardButton {
pub text: String,
pub icon_custom_emoji_id: Option<CustomEmojiId>,
pub style: Option<ButtonStyle>,
pub request: Option<ButtonRequest>,
}Expand description
This object represents one button of the reply keyboard.
For filter text buttons String can be used instead of this object to specify text of the button.
Fields§
§text: StringText of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed.
icon_custom_emoji_id: Option<CustomEmojiId>Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.
style: Option<ButtonStyle>Style of the button. If omitted, then an app-specific style is used.
request: Option<ButtonRequest>Request something from user. This is available in private chats only.
See ButtonRequest documentation for options on what can be
requested.
Implementations§
Source§impl KeyboardButton
impl KeyboardButton
pub fn new<T>(text: T) -> KeyboardButton
pub fn request<T>(self, val: T) -> KeyboardButtonwhere
T: Into<ButtonRequest>,
Trait Implementations§
Source§impl Clone for KeyboardButton
impl Clone for KeyboardButton
Source§fn clone(&self) -> KeyboardButton
fn clone(&self) -> KeyboardButton
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KeyboardButton
impl Debug for KeyboardButton
Source§impl<'de> Deserialize<'de> for KeyboardButton
impl<'de> Deserialize<'de> for KeyboardButton
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<KeyboardButton, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<KeyboardButton, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for KeyboardButton
Source§impl Hash for KeyboardButton
impl Hash for KeyboardButton
Source§impl PartialEq for KeyboardButton
impl PartialEq for KeyboardButton
Source§impl Serialize for KeyboardButton
impl Serialize for KeyboardButton
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,
impl StructuralPartialEq for KeyboardButton
Auto Trait Implementations§
impl Forget for KeyboardButton
impl Freeze for KeyboardButton
impl Move for KeyboardButton
impl RefUnwindSafe for KeyboardButton
impl Send for KeyboardButtonwhere
RawVecInner: Send,
impl Sync for KeyboardButtonwhere
RawVecInner: Sync,
impl Unpin for KeyboardButton
impl UnsafeUnpin for KeyboardButton
impl UnwindSafe for KeyboardButtonwhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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