Struct teloxide::types::InlineKeyboardMarkup
source · pub struct InlineKeyboardMarkup {
pub inline_keyboard: Vec<Vec<InlineKeyboardButton, Global>, Global>,
}
Expand description
This object represents an inline keyboard that appears right next to the message it belongs to.
Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.
Fields§
§inline_keyboard: Vec<Vec<InlineKeyboardButton, Global>, Global>
Array of button rows, each represented by an array of
InlineKeyboardButton
objects.
Implementations§
source§impl InlineKeyboardMarkup
impl InlineKeyboardMarkup
Build InlineKeyboardMarkup
.
Examples
use teloxide_core::types::{InlineKeyboardButton, InlineKeyboardMarkup};
let url = url::Url::parse("https://example.com").unwrap();
let url_button = InlineKeyboardButton::url("text".to_string(), url);
let keyboard = InlineKeyboardMarkup::default().append_row(vec![url_button]);
pub fn new<I>(inline_keyboard: I) -> InlineKeyboardMarkupwhere
I: IntoIterator,
<I as IntoIterator>::Item: IntoIterator<Item = InlineKeyboardButton>,
pub fn inline_keyboard<I>(self, val: I) -> InlineKeyboardMarkupwhere
I: IntoIterator,
<I as IntoIterator>::Item: IntoIterator<Item = InlineKeyboardButton>,
pub fn append_row<R>(self, buttons: R) -> InlineKeyboardMarkupwhere
R: IntoIterator<Item = InlineKeyboardButton>,
pub fn append_to_row(
self,
index: usize,
button: InlineKeyboardButton
) -> InlineKeyboardMarkup
Trait Implementations§
source§impl Clone for InlineKeyboardMarkup
impl Clone for InlineKeyboardMarkup
source§fn clone(&self) -> InlineKeyboardMarkup
fn clone(&self) -> InlineKeyboardMarkup
Returns a copy 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 Debug for InlineKeyboardMarkup
impl Debug for InlineKeyboardMarkup
source§impl Default for InlineKeyboardMarkup
impl Default for InlineKeyboardMarkup
source§fn default() -> InlineKeyboardMarkup
fn default() -> InlineKeyboardMarkup
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for InlineKeyboardMarkup
impl<'de> Deserialize<'de> for InlineKeyboardMarkup
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<InlineKeyboardMarkup, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<InlineKeyboardMarkup, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<InlineKeyboardMarkup> for ReplyMarkup
impl From<InlineKeyboardMarkup> for ReplyMarkup
source§fn from(original: InlineKeyboardMarkup) -> ReplyMarkup
fn from(original: InlineKeyboardMarkup) -> ReplyMarkup
Converts to this type from the input type.
source§impl Hash for InlineKeyboardMarkup
impl Hash for InlineKeyboardMarkup
source§impl PartialEq<InlineKeyboardMarkup> for InlineKeyboardMarkup
impl PartialEq<InlineKeyboardMarkup> for InlineKeyboardMarkup
source§fn eq(&self, other: &InlineKeyboardMarkup) -> bool
fn eq(&self, other: &InlineKeyboardMarkup) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for InlineKeyboardMarkup
impl Serialize for InlineKeyboardMarkup
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,
Serialize this value into the given Serde serializer. Read more
impl Eq for InlineKeyboardMarkup
impl StructuralEq for InlineKeyboardMarkup
impl StructuralPartialEq for InlineKeyboardMarkup
Auto Trait Implementations§
impl RefUnwindSafe for InlineKeyboardMarkup
impl Send for InlineKeyboardMarkup
impl Sync for InlineKeyboardMarkup
impl Unpin for InlineKeyboardMarkup
impl UnwindSafe for InlineKeyboardMarkup
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.