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 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
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> 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