pub struct KeyboardButton {
pub text: String,
pub icon_custom_emoji_id: Option<String>,
pub style: Option<ButtonStyle>,
pub request_users: Option<KeyboardButtonRequestUsers>,
pub request_chat: Option<KeyboardButtonRequestChat>,
pub request_managed_bot: Option<KeyboardButtonRequestManagedBot>,
pub request_contact: Option<bool>,
pub request_location: Option<bool>,
pub request_poll: Option<KeyboardButtonPollType>,
pub web_app: Option<WebAppInfo>,
}Expand description
One button in a reply keyboard.
Fields§
§text: StringLabel text on the button.
icon_custom_emoji_id: Option<String>Custom emoji identifier shown before the button text.
style: Option<ButtonStyle>Visual style of the button.
request_users: Option<KeyboardButtonRequestUsers>Request to select and share one or more users.
request_chat: Option<KeyboardButtonRequestChat>Request to select and share a chat.
request_managed_bot: Option<KeyboardButtonRequestManagedBot>Request a managed bot from the user.
request_contact: Option<bool>Requests the user’s phone number.
request_location: Option<bool>Requests the user’s current location.
request_poll: Option<KeyboardButtonPollType>Requests the user to create a poll.
web_app: Option<WebAppInfo>Web App to launch when the button is pressed.
Implementations§
Source§impl KeyboardButton
impl KeyboardButton
Sourcepub fn request_contact(label: impl Into<String>) -> Self
pub fn request_contact(label: impl Into<String>) -> Self
Creates a button that requests the user’s phone number.
Sourcepub fn request_location(label: impl Into<String>) -> Self
pub fn request_location(label: impl Into<String>) -> Self
Creates a button that requests the user’s location.
Trait Implementations§
Source§impl Clone for KeyboardButton
impl Clone for KeyboardButton
Source§fn clone(&self) -> KeyboardButton
fn clone(&self) -> KeyboardButton
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 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<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
Auto Trait Implementations§
impl Freeze for KeyboardButton
impl RefUnwindSafe for KeyboardButton
impl Send for KeyboardButton
impl Sync for KeyboardButton
impl Unpin for KeyboardButton
impl UnsafeUnpin for KeyboardButton
impl UnwindSafe for KeyboardButton
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