Struct tgbot::types::KeyboardButtonRequestUsers
source · pub struct KeyboardButtonRequestUsers { /* private fields */ }
Expand description
Represents a criteria used to request a suitable user.
The identifier of the selected user will be shared with the bot when the corresponding button is pressed.
Implementations§
source§impl KeyboardButtonRequestUsers
impl KeyboardButtonRequestUsers
sourcepub fn new(request_id: Integer) -> Self
pub fn new(request_id: Integer) -> Self
Creates a new KeyboardButtonRequestUsers
.
§Arguments
request_id
- Signed 32-bit identifier of the request, which will be received back in thecrate::types::MessageDataUsersShared
object; must be unique within the message.
sourcepub fn with_max_quantity(self, value: Integer) -> Self
pub fn with_max_quantity(self, value: Integer) -> Self
Sets a new max quantity
§Arguments
value
- The maximum number of users to be selected; 1-10; default - 1.
sourcepub fn with_request_name(self, value: bool) -> Self
pub fn with_request_name(self, value: bool) -> Self
Sets a new value for the request_name
flag.
§Arguments
value
- Whether to request the users’ first and last name.
sourcepub fn with_request_photo(self, value: bool) -> Self
pub fn with_request_photo(self, value: bool) -> Self
sourcepub fn with_request_username(self, value: bool) -> Self
pub fn with_request_username(self, value: bool) -> Self
Sets a new value for the request_username
flag.
§Arguments
value
- Whether to request users’ username.
sourcepub fn with_user_is_bot(self, value: bool) -> Self
pub fn with_user_is_bot(self, value: bool) -> Self
Sets a new value for a user_is_bot
flag.
§Arguments
value
- Indicates whether to request a bot or a regular user.
If not specified, no additional restrictions are applied.
Sets a new value for a user_is_premium
flag.
§Arguments
value
- Indicates whether to request a premium user.
If not specified, no additional restrictions are applied.
Trait Implementations§
source§impl Clone for KeyboardButtonRequestUsers
impl Clone for KeyboardButtonRequestUsers
source§fn clone(&self) -> KeyboardButtonRequestUsers
fn clone(&self) -> KeyboardButtonRequestUsers
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 KeyboardButtonRequestUsers
impl Debug for KeyboardButtonRequestUsers
source§impl<'de> Deserialize<'de> for KeyboardButtonRequestUsers
impl<'de> Deserialize<'de> for KeyboardButtonRequestUsers
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 PartialEq for KeyboardButtonRequestUsers
impl PartialEq for KeyboardButtonRequestUsers
source§fn eq(&self, other: &KeyboardButtonRequestUsers) -> bool
fn eq(&self, other: &KeyboardButtonRequestUsers) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for KeyboardButtonRequestUsers
impl PartialOrd for KeyboardButtonRequestUsers
source§fn partial_cmp(&self, other: &KeyboardButtonRequestUsers) -> Option<Ordering>
fn partial_cmp(&self, other: &KeyboardButtonRequestUsers) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moreimpl Copy for KeyboardButtonRequestUsers
impl StructuralPartialEq for KeyboardButtonRequestUsers
Auto Trait Implementations§
impl Freeze for KeyboardButtonRequestUsers
impl RefUnwindSafe for KeyboardButtonRequestUsers
impl Send for KeyboardButtonRequestUsers
impl Sync for KeyboardButtonRequestUsers
impl Unpin for KeyboardButtonRequestUsers
impl UnwindSafe for KeyboardButtonRequestUsers
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