pub struct Button { /* private fields */ }Expand description
A single inline keyboard button.
Implementations§
Source§impl Button
impl Button
Sourcepub fn callback(text: impl Into<String>, data: impl Into<Vec<u8>>) -> Self
pub fn callback(text: impl Into<String>, data: impl Into<Vec<u8>>) -> Self
A button that sends a callback data payload when pressed.
Sourcepub fn url(text: impl Into<String>, url: impl Into<String>) -> Self
pub fn url(text: impl Into<String>, url: impl Into<String>) -> Self
A button that opens a URL in the browser.
Sourcepub fn url_auth(
text: impl Into<String>,
url: impl Into<String>,
fwd_text: Option<String>,
bot: InputUser,
) -> Self
pub fn url_auth( text: impl Into<String>, url: impl Into<String>, fwd_text: Option<String>, bot: InputUser, ) -> Self
A button that opens a user-profile or bot link in Telegram.
Sourcepub fn switch_inline(text: impl Into<String>, query: impl Into<String>) -> Self
pub fn switch_inline(text: impl Into<String>, query: impl Into<String>) -> Self
A button that switches to inline mode in the current chat.
Sourcepub fn text(label: impl Into<String>) -> Self
pub fn text(label: impl Into<String>) -> Self
A plain text button (for reply keyboards, not inline).
Sourcepub fn switch_elsewhere(
text: impl Into<String>,
query: impl Into<String>,
) -> Self
pub fn switch_elsewhere( text: impl Into<String>, query: impl Into<String>, ) -> Self
A button that switches to inline mode in a different (user-chosen) chat.
Sourcepub fn webview(text: impl Into<String>, url: impl Into<String>) -> Self
pub fn webview(text: impl Into<String>, url: impl Into<String>) -> Self
A button that opens a mini-app WebView.
Sourcepub fn simple_webview(text: impl Into<String>, url: impl Into<String>) -> Self
pub fn simple_webview(text: impl Into<String>, url: impl Into<String>) -> Self
A button that opens a simple WebView (no JS bridge).
Sourcepub fn request_phone(text: impl Into<String>) -> Self
pub fn request_phone(text: impl Into<String>) -> Self
A button that requests the user’s phone number (reply keyboards only).
Sourcepub fn request_geo(text: impl Into<String>) -> Self
pub fn request_geo(text: impl Into<String>) -> Self
A button that requests the user’s location (reply keyboards only).
Sourcepub fn request_poll(text: impl Into<String>) -> Self
pub fn request_poll(text: impl Into<String>) -> Self
A button that requests the user to create/share a poll.
Sourcepub fn request_quiz(text: impl Into<String>) -> Self
pub fn request_quiz(text: impl Into<String>) -> Self
A button that requests the user to create/share a quiz.
Sourcepub fn copy_text(text: impl Into<String>, copy_text: impl Into<String>) -> Self
pub fn copy_text(text: impl Into<String>, copy_text: impl Into<String>) -> Self
A copy-to-clipboard button.
Sourcepub fn into_raw(self) -> KeyboardButton
pub fn into_raw(self) -> KeyboardButton
Consume into the raw TL type.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Button
impl RefUnwindSafe for Button
impl Send for Button
impl Sync for Button
impl Unpin for Button
impl UnsafeUnpin for Button
impl UnwindSafe for Button
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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