Struct carapax::types::ReplyKeyboardMarkup
source · pub struct ReplyKeyboardMarkup { /* private fields */ }
Expand description
Represents a custom keyboard with reply options.
Implementations§
source§impl ReplyKeyboardMarkup
impl ReplyKeyboardMarkup
sourcepub fn add_row<T>(self, value: T) -> ReplyKeyboardMarkupwhere
T: IntoIterator<Item = KeyboardButton>,
pub fn add_row<T>(self, value: T) -> ReplyKeyboardMarkupwhere
T: IntoIterator<Item = KeyboardButton>,
sourcepub fn with_input_field_placeholder<T>(self, value: T) -> ReplyKeyboardMarkup
pub fn with_input_field_placeholder<T>(self, value: T) -> ReplyKeyboardMarkup
Sets a new input field placeholder.
§Arguments
value
- The placeholder to be shown in the input field when the keyboard is active; 1-64 characters.
sourcepub fn with_one_time_keyboard(self, value: bool) -> ReplyKeyboardMarkup
pub fn with_one_time_keyboard(self, value: bool) -> ReplyKeyboardMarkup
Sets a new value for an one_time_keyboard
flag.
§Arguments
value
- Indicates whether to request clients to hide the keyboard as soon as it’s been used; default - false.
The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again.
sourcepub fn with_is_persistent(self, value: bool) -> ReplyKeyboardMarkup
pub fn with_is_persistent(self, value: bool) -> ReplyKeyboardMarkup
Sets a new value for an is_persistent
flag.
§Arguments
value
- Indicates whether to request clients to always show the keyboard when the regular keyboard is hidden.
Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon.
sourcepub fn with_resize_keyboard(self, value: bool) -> ReplyKeyboardMarkup
pub fn with_resize_keyboard(self, value: bool) -> ReplyKeyboardMarkup
Sets a new value for a resize_keyboard
flag.
§Arguments
value
- Indicates whether to request clients to resize the keyboard vertically for optimal fit.
E.g., make the keyboard smaller if there are just two rows of buttons. Defaults to false, in which case the custom keyboard is always of the same height as the app’s standard keyboard.
sourcepub fn with_selective(self, value: bool) -> ReplyKeyboardMarkup
pub fn with_selective(self, value: bool) -> ReplyKeyboardMarkup
Sets a new value for a selective
flag.
§Arguments
value
- Indicates whether to show the keyboard to specific users only.
Targets:
- users that are @mentioned in the text of the
crate::types::Message
object. - if the bot message is a reply (has
reply_to_message_id
), sender of the original message.
Example: A user requests to change the bot‘s language, bot replies to the request with a keyboard to select the new language. Other users in the group don’t see the keyboard.
Trait Implementations§
source§impl Clone for ReplyKeyboardMarkup
impl Clone for ReplyKeyboardMarkup
source§fn clone(&self) -> ReplyKeyboardMarkup
fn clone(&self) -> ReplyKeyboardMarkup
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ReplyKeyboardMarkup
impl Debug for ReplyKeyboardMarkup
source§impl Default for ReplyKeyboardMarkup
impl Default for ReplyKeyboardMarkup
source§fn default() -> ReplyKeyboardMarkup
fn default() -> ReplyKeyboardMarkup
source§impl<'de> Deserialize<'de> for ReplyKeyboardMarkup
impl<'de> Deserialize<'de> for ReplyKeyboardMarkup
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<ReplyKeyboardMarkup, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ReplyKeyboardMarkup, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl<A, B> From<A> for ReplyKeyboardMarkup
impl<A, B> From<A> for ReplyKeyboardMarkup
source§fn from(value: A) -> ReplyKeyboardMarkup
fn from(value: A) -> ReplyKeyboardMarkup
source§impl From<ReplyKeyboardMarkup> for ReplyMarkup
impl From<ReplyKeyboardMarkup> for ReplyMarkup
source§fn from(original: ReplyKeyboardMarkup) -> ReplyMarkup
fn from(original: ReplyKeyboardMarkup) -> ReplyMarkup
source§impl PartialEq for ReplyKeyboardMarkup
impl PartialEq for ReplyKeyboardMarkup
source§fn eq(&self, other: &ReplyKeyboardMarkup) -> bool
fn eq(&self, other: &ReplyKeyboardMarkup) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ReplyKeyboardMarkup
impl PartialOrd for ReplyKeyboardMarkup
source§fn partial_cmp(&self, other: &ReplyKeyboardMarkup) -> Option<Ordering>
fn partial_cmp(&self, other: &ReplyKeyboardMarkup) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for ReplyKeyboardMarkup
impl Serialize for ReplyKeyboardMarkup
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,
impl StructuralPartialEq for ReplyKeyboardMarkup
Auto Trait Implementations§
impl Freeze for ReplyKeyboardMarkup
impl RefUnwindSafe for ReplyKeyboardMarkup
impl Send for ReplyKeyboardMarkup
impl Sync for ReplyKeyboardMarkup
impl Unpin for ReplyKeyboardMarkup
impl UnwindSafe for ReplyKeyboardMarkup
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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