Struct tgbot::types::SharedUser
source · pub struct SharedUser {
pub user_id: Integer,
pub first_name: Option<String>,
pub last_name: Option<String>,
pub photo: Option<Vec<PhotoSize>>,
pub username: Option<String>,
}
Expand description
Contains information about a user that
was shared with the bot using a crate::types::KeyboardButtonRequestUsers
button.
Fields§
§user_id: Integer
Identifier of the shared user.
The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.
first_name: Option<String>
First name of the user, if the name was requested by the bot.
last_name: Option<String>
Last name of the user, if the name was requested by the bot.
photo: Option<Vec<PhotoSize>>
Available sizes of the user photo, if the photo was requested by the bot
username: Option<String>
Username of the user, if the username was requested by the bot.
Implementations§
sourcepub fn with_first_name<T>(self, value: T) -> Self
pub fn with_first_name<T>(self, value: T) -> Self
sourcepub fn with_last_name<T>(self, value: T) -> Self
pub fn with_last_name<T>(self, value: T) -> Self
sourcepub fn with_photo<T>(self, value: T) -> Selfwhere
T: IntoIterator<Item = PhotoSize>,
pub fn with_photo<T>(self, value: T) -> Selfwhere
T: IntoIterator<Item = PhotoSize>,
sourcepub fn with_username<T>(self, value: T) -> Self
pub fn with_username<T>(self, value: T) -> Self
Trait Implementations§
source§fn clone(&self) -> SharedUser
fn clone(&self) -> SharedUser
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§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§fn eq(&self, other: &SharedUser) -> bool
fn eq(&self, other: &SharedUser) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§fn partial_cmp(&self, other: &SharedUser) -> Option<Ordering>
fn partial_cmp(&self, other: &SharedUser) -> 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 moreAuto Trait Implementations§
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> 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>
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