Struct tgbot::types::ReplyKeyboardMarkup

source ·
pub struct ReplyKeyboardMarkup { /* private fields */ }
Expand description

Represents a custom keyboard with reply options.

Implementations§

source§

impl ReplyKeyboardMarkup

source

pub fn add_row<T>(self, value: T) -> Self
where T: IntoIterator<Item = KeyboardButton>,

Adds a row to the markup.

§Arguments
  • value - The row to add.
source

pub fn with_input_field_placeholder<T>(self, value: T) -> Self
where T: Into<String>,

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

pub fn with_one_time_keyboard(self, value: bool) -> Self

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.

source

pub fn with_is_persistent(self, value: bool) -> Self

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.

source

pub fn with_resize_keyboard(self, value: bool) -> Self

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.

source

pub fn with_selective(self, value: bool) -> Self

Sets a new value for a selective flag.

§Arguments
  • value - Indicates whether to show the keyboard to specific users only.

Targets:

  1. users that are @mentioned in the text of the crate::types::Message object.
  2. 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

source§

fn clone(&self) -> ReplyKeyboardMarkup

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ReplyKeyboardMarkup

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ReplyKeyboardMarkup

source§

fn default() -> ReplyKeyboardMarkup

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for ReplyKeyboardMarkup

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<A, B> From<A> for ReplyKeyboardMarkup
where A: IntoIterator<Item = B>, B: IntoIterator<Item = KeyboardButton>,

source§

fn from(value: A) -> ReplyKeyboardMarkup

Converts to this type from the input type.
source§

impl From<ReplyKeyboardMarkup> for ReplyMarkup

source§

fn from(original: ReplyKeyboardMarkup) -> ReplyMarkup

Converts to this type from the input type.
source§

impl PartialEq for ReplyKeyboardMarkup

source§

fn eq(&self, other: &ReplyKeyboardMarkup) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for ReplyKeyboardMarkup

source§

fn partial_cmp(&self, other: &ReplyKeyboardMarkup) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for ReplyKeyboardMarkup

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for ReplyKeyboardMarkup

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromRef<T> for T
where T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,