pub struct InlineKeyboard { /* private fields */ }Expand description
Builder for an inline keyboard reply markup.
Each call to row adds a new horizontal row of
buttons. Rows are displayed top-to-bottom.
§Example
use layer_client::keyboard::{InlineKeyboard, Button};
let kb = InlineKeyboard::new()
.row([Button::callback("Option A", b"a"),
Button::callback("Option B", b"b")])
.row([Button::url("More info", "https://example.com")]);Implementations§
Source§impl InlineKeyboard
impl InlineKeyboard
Sourcepub fn row(self, buttons: impl IntoIterator<Item = Button>) -> Self
pub fn row(self, buttons: impl IntoIterator<Item = Button>) -> Self
Append a row of buttons.
Sourcepub fn into_markup(self) -> ReplyMarkup
pub fn into_markup(self) -> ReplyMarkup
Convert to the ReplyMarkup TL type expected by message-sending functions.
Trait Implementations§
Source§impl Clone for InlineKeyboard
impl Clone for InlineKeyboard
Source§fn clone(&self) -> InlineKeyboard
fn clone(&self) -> InlineKeyboard
Returns a duplicate 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 Default for InlineKeyboard
impl Default for InlineKeyboard
Source§fn default() -> InlineKeyboard
fn default() -> InlineKeyboard
Returns the “default value” for a type. Read more
Source§impl From<InlineKeyboard> for ReplyMarkup
impl From<InlineKeyboard> for ReplyMarkup
Source§fn from(kb: InlineKeyboard) -> Self
fn from(kb: InlineKeyboard) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for InlineKeyboard
impl RefUnwindSafe for InlineKeyboard
impl Send for InlineKeyboard
impl Sync for InlineKeyboard
impl Unpin for InlineKeyboard
impl UnsafeUnpin for InlineKeyboard
impl UnwindSafe for InlineKeyboard
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