Skip to main content

User

Struct User 

Source
pub struct User {
Show 27 fields pub id: i64, pub first_name: String, pub last_name: String, pub usernames: Option<Usernames>, pub phone_number: String, pub status: UserStatus, pub profile_photo: Option<ProfilePhoto>, pub accent_color_id: i32, pub background_custom_emoji_id: i64, pub upgraded_gift_colors: Option<UpgradedGiftColors>, pub profile_accent_color_id: i32, pub profile_background_custom_emoji_id: i64, pub emoji_status: Option<EmojiStatus>, pub is_contact: bool, pub is_mutual_contact: bool, pub is_close_friend: bool, pub verification_status: Option<VerificationStatus>, pub is_premium: bool, pub is_support: bool, pub restriction_info: Option<RestrictionInfo>, pub active_story_state: Option<ActiveStoryState>, pub restricts_new_chats: bool, pub paid_message_star_count: i64, pub have_access: bool, pub type: UserType, pub language_code: String, pub added_to_attachment_menu: bool,
}
Expand description

Represents a user

Fields§

§id: i64

User identifier

§first_name: String

First name of the user

§last_name: String

Last name of the user

§usernames: Option<Usernames>

Usernames of the user; may be null

§phone_number: String

Phone number of the user

§status: UserStatus

Current online status of the user

§profile_photo: Option<ProfilePhoto>

Profile photo of the user; may be null

§accent_color_id: i32

Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview

§background_custom_emoji_id: i64

Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none

§upgraded_gift_colors: Option<UpgradedGiftColors>

Color scheme based on an upgraded gift to be used for the user instead of accent_color_id and background_custom_emoji_id; may be null if none

§profile_accent_color_id: i32

Identifier of the accent color for the user’s profile; -1 if none

§profile_background_custom_emoji_id: i64

Identifier of a custom emoji to be shown on the background of the user’s profile; 0 if none

§emoji_status: Option<EmojiStatus>

Emoji status to be shown instead of the default Telegram Premium badge; may be null

§is_contact: bool

The user is a contact of the current user

§is_mutual_contact: bool

The user is a contact of the current user and the current user is a contact of the user

§is_close_friend: bool

The user is a close friend of the current user; implies that the user is a contact

§verification_status: Option<VerificationStatus>

Information about verification status of the user; may be null if none

§is_premium: bool

True, if the user is a Telegram Premium user

§is_support: bool

True, if the user is Telegram support account

§restriction_info: Option<RestrictionInfo>

Information about restrictions that must be applied to the corresponding private chat; may be null if none

§active_story_state: Option<ActiveStoryState>

State of active stories of the user; may be null if the user has no active stories

§restricts_new_chats: bool

True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them

§paid_message_star_count: i64

Number of Telegram Stars that must be paid by general user for each sent message to the user. If positive and userFullInfo is unknown, use canSendMessageToUser to check whether the current user must pay

§have_access: bool

If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can’t be passed to any method

§type: UserType

Type of the user

§language_code: String

IETF language tag of the user’s language; only available to bots

§added_to_attachment_menu: bool

True, if the user added the current bot to attachment menu; only available to bots

Trait Implementations§

Source§

impl Clone for User

Source§

fn clone(&self) -> User

Returns a duplicate 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 User

Source§

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

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

impl<'de> Deserialize<'de> for User

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 PartialEq for User

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for User

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 User

Auto Trait Implementations§

§

impl Freeze for User

§

impl RefUnwindSafe for User

§

impl Send for User

§

impl Sync for User

§

impl Unpin for User

§

impl UnsafeUnpin for User

§

impl UnwindSafe for User

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

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>,

Source§

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>,

Source§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,