pub struct User {
pub raw: User,
}Expand description
Typed wrapper over tl::enums::User.
Fields§
§raw: UserImplementations§
Source§impl User
impl User
Sourcepub fn access_hash(&self) -> Option<i64>
pub fn access_hash(&self) -> Option<i64>
Access hash needed for API calls.
Sourcepub fn first_name(&self) -> Option<&str>
pub fn first_name(&self) -> Option<&str>
First name.
true if this is a premium account.
Sourcepub fn status(&self) -> Option<&UserStatus>
pub fn status(&self) -> Option<&UserStatus>
The user’s current online status.
Sourcepub fn photo(&self) -> Option<&UserProfilePhoto>
pub fn photo(&self) -> Option<&UserProfilePhoto>
Profile photo, if set.
Sourcepub fn mutual_contact(&self) -> bool
pub fn mutual_contact(&self) -> bool
true if the logged-in user is also in this user’s contact list.
Sourcepub fn restricted(&self) -> bool
pub fn restricted(&self) -> bool
true if this account has been restricted (e.g. spam-banned).
Sourcepub fn bot_privacy(&self) -> bool
pub fn bot_privacy(&self) -> bool
true if the bot does not display in inline mode publicly.
Sourcepub fn bot_supports_chats(&self) -> bool
pub fn bot_supports_chats(&self) -> bool
true if the bot supports being added to groups.
Sourcepub fn bot_inline_geo(&self) -> bool
pub fn bot_inline_geo(&self) -> bool
true if the bot can be used inline even without a location share.
Sourcepub fn restriction_reason(&self) -> Vec<&RestrictionReason>
pub fn restriction_reason(&self) -> Vec<&RestrictionReason>
Restriction reasons (why this account is unavailable in certain regions).
Sourcepub fn bot_inline_placeholder(&self) -> Option<&str>
pub fn bot_inline_placeholder(&self) -> Option<&str>
Bot inline placeholder text (shown in the compose bar when the user activates inline mode).
Sourcepub fn as_input_peer(&self) -> InputPeer
pub fn as_input_peer(&self) -> InputPeer
Convert to an InputPeer for API calls (requires access hash).
Trait Implementations§
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> 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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