User

Struct User 

Source
pub struct User<'a> {
Show 37 fields pub contributors_enabled: bool, pub created_at: DateTime, pub default_profile: bool, pub default_profile_image: bool, pub description: Option<Cow<'a, str>>, pub favourites_count: u64, pub follow_request_sent: Option<bool>, pub followers_count: u64, pub friends_count: u64, pub geo_enabled: bool, pub id: UserId, pub is_translator: bool, pub lang: Cow<'a, str>, pub listed_count: u64, pub location: Option<Cow<'a, str>>, pub name: Cow<'a, str>, pub profile_background_color: Cow<'a, str>, pub profile_background_image_url: Option<Cow<'a, str>>, pub profile_background_image_url_https: Option<Cow<'a, str>>, pub profile_background_tile: bool, pub profile_banner_url: Option<Cow<'a, str>>, pub profile_image_url: Cow<'a, str>, pub profile_image_url_https: Cow<'a, str>, pub profile_link_color: Cow<'a, str>, pub profile_sidebar_border_color: Cow<'a, str>, pub profile_sidebar_fill_color: Cow<'a, str>, pub profile_text_color: Cow<'a, str>, pub profile_use_background_image: bool, pub protected: bool, pub screen_name: Cow<'a, str>, pub statuses_count: u64, pub time_zone: Option<Cow<'a, str>>, pub url: Option<Cow<'a, str>>, pub utc_offset: Option<i64>, pub verified: bool, pub withheld_in_countries: Option<Cow<'a, str>>, pub withheld_scope: Option<WithheldScope<'a>>,
}
Expand description

Represents a user on Twitter.

§Reference

  1. Users — Twitter Developers

Fields§

§contributors_enabled: bool

Indicates that the user has an account with “contributor mode” enabled, allowing for Tweets issued by the user to be co-authored by another account. Rarely true.

§created_at: DateTime

The UTC datetime that the user account was created on Twitter.

§default_profile: bool

When true, indicates that the user has not altered the theme or background of their user profile.

§default_profile_image: bool

When true, indicates that the user has not uploaded their own avatar and a default egg avatar is used instead.

§description: Option<Cow<'a, str>>

The user-defined UTF-8 string describing their account.

§favourites_count: u64

The number of tweets this user has favorited in the account’s lifetime. British spelling used in the field name for historical reasons.

§follow_request_sent: Option<bool>

Perspectival. When true, indicates that the authenticating user has issued a follow request to this protected user account.

§followers_count: u64

The number of followers this account currently has. Under certain conditions of duress, this field will temporarily indicate 0.

§friends_count: u64

The number of users this account is following (AKA their “followings”). Under certain conditions of duress, this field will temporarily indicate 0.

§geo_enabled: bool

When true, indicates that the user has enabled the possibility of geotagging their Tweets. This field must be true for the current user to attach geographic data when using POST statuses / update.

§id: UserId

The integer representation of the unique identifier for this User.

§is_translator: bool

When true, indicates that the user is a participant in Twitter’s translator community.

§lang: Cow<'a, str>

The BCP 47 code for the user’s self-declared user interface language. May or may not have anything to do with the content of their Tweets.

§listed_count: u64

The number of public lists that this user is a member of.

§location: Option<Cow<'a, str>>

The user-defined location for this account’s profile. Not necessarily a location nor parseable. This field will occasionally be fuzzily interpreted by the Search service.

§name: Cow<'a, str>

The name of the user, as they’ve defined it. Not necessarily a person’s name. Typically capped at 20 characters, but subject to change.

§profile_background_color: Cow<'a, str>

The hexadecimal color chosen by the user for their background.

§profile_background_image_url: Option<Cow<'a, str>>

A HTTP-based URL pointing to the background image the user has uploaded for their profile.

§profile_background_image_url_https: Option<Cow<'a, str>>

A HTTPS-based URL pointing to the background image the user has uploaded for their profile.

§profile_background_tile: bool

When true, indicates that the user’s profile_background_image_url should be tiled when displayed.

§profile_banner_url: Option<Cow<'a, str>>

The HTTPS-based URL pointing to the standard web representation of the user’s uploaded profile banner. By adding a final path element of the URL, you can obtain different image sizes optimized for specific displays.

In the future, an API method will be provided to serve these URLs so that you need not modify the original URL.

For size variations, please see User Profile Images and Banners.

§profile_image_url: Cow<'a, str>

A HTTP-based URL pointing to the user’s avatar image. See User Profile Images and Banners.

§profile_image_url_https: Cow<'a, str>

A HTTPS-based URL pointing to the user’s avatar image.

§profile_link_color: Cow<'a, str>

The hexadecimal color the user has chosen to display links with in their Twitter UI.

§profile_sidebar_border_color: Cow<'a, str>

The hexadecimal color the user has chosen to display sidebar borders with in their Twitter UI.

§profile_sidebar_fill_color: Cow<'a, str>

The hexadecimal color the user has chosen to display sidebar backgrounds with in their Twitter UI.

§profile_text_color: Cow<'a, str>

The hexadecimal color the user has chosen to display text with in their Twitter UI.

§profile_use_background_image: bool

When true, indicates the user wants their uploaded background image to be used.

§protected: bool

When true, indicates that this user has chosen to protect their Tweets. See About Public and Protected Tweets.

§screen_name: Cow<'a, str>

The screen name, handle, or alias that this user identifies themselves with.

screen_names are unique but subject to change. Use id as a user identifier whenever possible.

Typically a maximum of 15 characters long, but some historical accounts may exist with longer names.

§statuses_count: u64

The number of tweets (including retweets) issued by the user.

§time_zone: Option<Cow<'a, str>>

A string describing the Time Zone this user declares themselves within.

§url: Option<Cow<'a, str>>

A URL provided by the user in association with their profile.

§utc_offset: Option<i64>

The offset from GMT/UTC in seconds.

§verified: bool

When true, indicates that the user has a verified account. See Verified Accounts.

§withheld_in_countries: Option<Cow<'a, str>>

When present, indicates a textual representation of the two-letter country codes this user is withheld from.

§withheld_scope: Option<WithheldScope<'a>>

When present, indicates whether the content being withheld is the Status or a User.

Trait Implementations§

Source§

impl<'a> Clone for User<'a>

Source§

fn clone(&self) -> User<'a>

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<'a> Debug for User<'a>

Source§

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

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

impl<'de: 'a, 'a> Deserialize<'de> for User<'a>

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

Source§

fn eq(&self, other: &User<'a>) -> 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<'a> StructuralPartialEq for User<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for User<'a>

§

impl<'a> RefUnwindSafe for User<'a>

§

impl<'a> Send for User<'a>

§

impl<'a> Sync for User<'a>

§

impl<'a> Unpin for User<'a>

§

impl<'a> UnwindSafe for User<'a>

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