pub struct ProfilePhoto { /* private fields */ }Expand description
Unifies UserProfilePhoto and ChatPhoto behind one downloadable
type. Unlike Photo, profile/chat photos are addressed by peer, not
by the photo’s own id, so the owning InputPeer has to travel with it.
Implementations§
Source§impl ProfilePhoto
impl ProfilePhoto
Sourcepub fn new(peer: InputPeer, photo_id: i64, dc_id: i32, big: bool) -> Self
pub fn new(peer: InputPeer, photo_id: i64, dc_id: i32, big: bool) -> Self
big selects the full-size photo; false is the small variant
clients use for avatar thumbnails.
Sourcepub fn from_user(peer: InputPeer, photo: &UserProfilePhoto) -> Option<Self>
pub fn from_user(peer: InputPeer, photo: &UserProfilePhoto) -> Option<Self>
Build from a user’s UserProfilePhoto. None if the user has no
photo (userProfilePhotoEmpty).
Trait Implementations§
Source§impl Clone for ProfilePhoto
impl Clone for ProfilePhoto
Source§fn clone(&self) -> ProfilePhoto
fn clone(&self) -> ProfilePhoto
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ProfilePhoto
impl Debug for ProfilePhoto
Source§impl Downloadable for ProfilePhoto
impl Downloadable for ProfilePhoto
Source§fn to_input_location(&self) -> Option<InputFileLocation>
fn to_input_location(&self) -> Option<InputFileLocation>
Return the
InputFileLocation needed for upload.getFile.Auto Trait Implementations§
impl Freeze for ProfilePhoto
impl RefUnwindSafe for ProfilePhoto
impl Send for ProfilePhoto
impl Sync for ProfilePhoto
impl Unpin for ProfilePhoto
impl UnsafeUnpin for ProfilePhoto
impl UnwindSafe for ProfilePhoto
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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